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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/typechecker/check-expr.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/typechecker/check-expr.sml

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

revision 3418, Fri Nov 13 00:00:26 2015 UTC revision 3421, Fri Nov 13 13:05:06 2015 UTC
# Line 468  Line 468 
468                   of SOME x' => (AST.E_Var(useVar(cxt, x')), Var.monoTypeOf x')                   of SOME x' => (AST.E_Var(useVar(cxt, x')), Var.monoTypeOf x')
469                    | NONE => err(cxt, [S "undeclared variable ", A x])                    | NONE => err(cxt, [S "undeclared variable ", A x])
470                  (* end case *))                  (* end case *))
471              | PT.E_Kernel(kern, dim) => raise Fail "FIXME"              | PT.E_Kernel(kern, dim) => (case E.findVar (env, kern)
472                     of SOME kern' => (case Var.monoTypeOf kern'
473                           of ty as Ty.T_Kernel(Ty.DiffConst k) => let
474                                val k' = Int.fromLarge dim handle Overflow => 1073741823
475                                val e = AST.E_Var(useVar(cxt, kern'))
476                                in
477                                  if (k = k')
478                                    then (e, ty)
479                                    else let
480                                      val ty' = Ty.T_Kernel(Ty.DiffConst k')
481                                      in
482                                        (AST.E_Coerce{srcTy = ty, dstTy = ty', e = e}, ty')
483                                      end
484                                end
485                            | _ => err(cxt, [S "expected kernel, but found ", S(Var.kindToString kern')])
486                          (* end case *))
487                      | NONE => err(cxt, [S "unknown kernel ", A kern])
488                    (* end case *))
489              | PT.E_Lit lit => checkLit lit              | PT.E_Lit lit => checkLit lit
490              | PT.E_Id d => let              | PT.E_Id d => let
491                  val (tyArgs, Ty.T_Fun(_, rngTy)) =                  val (tyArgs, Ty.T_Fun(_, rngTy)) =

Legend:
Removed from v.3418  
changed lines
  Added in v.3421

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