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 3421, Fri Nov 13 13:05:06 2015 UTC revision 3422, Fri Nov 13 14:17:49 2015 UTC
# Line 511  Line 511 
511                      then (AST.E_Prim(BV.nan, tyArgs, [], rngTy), rngTy)                      then (AST.E_Prim(BV.nan, tyArgs, [], rngTy), rngTy)
512                      else raise Fail "impossible"                      else raise Fail "impossible"
513                  end                  end
514              | PT.E_Sequence exps => raise Fail "FIXME"              | PT.E_Sequence exps => (case checkList (env, cxt, exps)
515    (* FIXME: need kind for concrete types here! *)
516                     of ([], _) => let
517                          val ty = Ty.T_Sequence(Ty.T_Var(MetaVar.newTyVar()), SOME(Ty.DimConst 0))
518                          in
519                            (AST.E_Seq([], ty), ty)
520                          end
521                      | (args, tys) => (case Util.coerceTypes(List.map TU.pruneHead tys)
522                           of SOME ty => if TU.isValueType ty
523                                then let
524                                  fun doExp eTy = valOf(Util.coerceType (ty, eTy))
525                                  val resTy = Ty.T_Sequence(ty, SOME(Ty.DimConst(List.length args)))
526                                  val args = ListPair.map doExp (args, tys)
527                                  in
528                                    (AST.E_Seq(args, resTy), resTy)
529                                  end
530                                else err(cxt, [S "sequence expression of non-value argument type"])
531                            | NONE => err(cxt, [S "arguments of sequence expression must have same type"])
532                          (* end case *))
533                    (* end case *))
534              | PT.E_SeqComp comp => raise Fail "FIXME"              | PT.E_SeqComp comp => raise Fail "FIXME"
535              | PT.E_Cons args => let              | PT.E_Cons args => let
536                (* Note that we are guaranteed that args is non-empty *)                (* Note that we are guaranteed that args is non-empty *)

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

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