Open DylanSp opened 1 year ago
If I implement the idea from https://github.com/DylanSp/faust-lang/issues/28 about parametrizing AST nodes with type info - the typechecker could, instead of returning "successfully typechecked" vs. "type error(s)", include type errors in the annotated AST:
type Type = TypeBool | TypeInt | TypeError;
interface TypeError {
tag: "Error";
location: ast.Location;
message: string;
}
See https://matklad.github.io/2023/08/17/typescript-is-surprisingly-ok-for-compilers.html.
TypeError
would be equal to any other type when typechecking to prevent cascading failures.TypeError
's in the annotated AST.
Reference https://github.com/DylanSp/faust-lang/issues/2
No type inference - all variable and function declarations must be explicitly typed.