Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /trunk/src/compiler/typechecker/typechecker.sml
ViewVC logotype

Diff of /trunk/src/compiler/typechecker/typechecker.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 169, Thu Jul 22 20:07:37 2010 UTC revision 170, Sat Jul 24 13:30:47 2010 UTC
# Line 126  Line 126 
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

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0