public TypeExpr Visit(ConsParamTy p, ParsingContext ctx) { var final = p.ParamTypeDecl_.Accept(this, ctx); var ty = TyArr.Create(p.TypeExpr_, final, ctx); return(ty); }
private void CheckTypeCtorKind(TypeCtorSig sig) { //TODO _definingCtor.Name != Int , Double, String TypeExpr ctorKind = UType.Instance; for (var i = 0; i < _definingCtor.ParamList.Length; i++) { if (_definingCtorEnv.ContainsKey(_definingCtor.ParamList[i])) { throw new SemanticException($"duplicated parameter names of Type Constructor:{_definingCtor.ParamList[i]}", _definingCtor.Loc); } _definingCtorEnv.Add(_definingCtor.ParamList[i], UType.Instance); ctorKind = TyArr.Create(UType.Instance, ctorKind, this); } _definingCtorEnv.Add(_definingCtor.Name, ctorKind); _definingCtor.Kind = ctorKind; }
public TypeExpr Visit(LastParamTy p, ParsingContext ctx) { var ty = new TyArr(p.TypeExpr_, ctx.DefiningCtorAsType(), p._lexLocation, ctx); return(ty); }