예제 #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);
 }