Typechecker

- Removed `assert(false)` in code which handles a mismatched parameter type versus argument type, replaced with a throws `TypeMismatchException`
This commit is contained in:
Tristan B. Velloza Kildaire 2023-02-11 12:19:44 +02:00
parent ab66860e7b
commit 03a998bae8
1 changed files with 2 additions and 1 deletions

View File

@ -1065,7 +1065,8 @@ public final class TypeChecker
printCodeQueue();
gprintln("Wrong actual argument type for function call", DebugType.ERROR);
gprintln("Cannot pass value of type '"~argType.getName()~"' to function accepting '"~parmType.getName()~"'", DebugType.ERROR);
assert(false);
throw new TypeMismatchException(this, parmType, argType, "The actual argument's type does not match that of the function's parameter type");
}
parmCount--;