示例#1
0
文件: TEAbs.cs 项目: takuto-h/omicron
 public IType Eval(ITypeEnv typeEnv)
 {
     Unique unique = new Unique();
     typeEnv = typeEnv.MakeChild();
     typeEnv.Add(mTypeVarName, new TVar(unique));
     IType type = mTypeExpr.Eval(typeEnv);
     return new TAbs(unique, type);
 }
示例#2
0
 public IType Check(
     ITypeCtxt typeCtxt,
     ITypeEnv typeEnv,
     IValueCtxt valueCtxt
 )
 {
     Unique unique = new Unique();
     typeCtxt = typeCtxt.MakeChild();
     typeEnv = typeEnv.MakeChild();
     typeCtxt.Add(mTypeVarName, mKind);
     typeEnv.Add(mTypeVarName, new TVar(unique));
     IType type = mValueExpr.Check(typeCtxt, typeEnv, valueCtxt);
     return MakePolymorphicType(unique, mKind, type);
 }