Skip to content
Snippets Groups Projects
Commit 61061d03 authored by Etienne Kneuss's avatar Etienne Kneuss Committed by Philippe Suter
Browse files

Use new typecheck stuff, to be added to all trees

parent 58f44d20
No related branches found
No related tags found
No related merge requests found
......@@ -79,11 +79,7 @@ object Trees {
case class FunctionInvocation(funDef: FunDef, args: Seq[Expr]) extends Expr with FixedType with ScalacPositional {
val fixedType = funDef.returnType
funDef.args.zip(args).foreach{ case (a, c) =>
if (!isSubtypeOf(c.getType, a.tpe)) {
throw new TypeErrorException("Invalid invocation of "+funDef.id+": argument "+a.id+":"+a.tpe+" was passed "+c+":"+c.getType)
}
}
funDef.args.zip(args).foreach{ case (a, c) => typeCheck(c, a.tpe) }
}
case class IfExpr(cond: Expr, then: Expr, elze: Expr) extends Expr
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment