SCM Repository
[diderot] Diff of /trunk/src/compiler/typechecker/typechecker.sml
Diff of /trunk/src/compiler/typechecker/typechecker.sml
Parent Directory
|
Revision Log
|
Patch
126 |
fun checkExpr (env : env, cxt, e) = (case e |
fun checkExpr (env : env, cxt, e) = (case e |
127 |
of PT.E_Mark m => checkExpr (withEnvAndContext (env, cxt, m)) |
of PT.E_Mark m => checkExpr (withEnvAndContext (env, cxt, m)) |
128 |
| PT.E_Var x => (case Env.findVar (#env env, x) |
| PT.E_Var x => (case Env.findVar (#env env, x) |
129 |
of SOME x' => let |
of SOME x' => (case Var.typeOf x' |
130 |
val (args, ty) = Util.instantiate(Var.typeOf x') |
of ([], ty) => (AST.E_Var x', ty) |
131 |
in |
| _ => raise Fail "Unexpected polymorphic variable" |
132 |
(AST.E_Var(x', args, ty), ty) |
(* end case *)) |
|
end |
|
133 |
| NONE => err(cxt, [S "undeclared variable ", A x]) |
| NONE => err(cxt, [S "undeclared variable ", A x]) |
134 |
(* end case *)) |
(* end case *)) |
135 |
| PT.E_Lit lit => checkLit lit |
| PT.E_Lit lit => checkLit lit |
|
Legend:
Removed from v.169 |
|
changed lines |
|
Added in v.170 |
|
|