more helpful defNew error message

This commit is contained in:
2022-10-06 01:19:58 +00:00
parent 2f6431f8c2
commit 52c1b570ab

View File

@@ -855,6 +855,8 @@ class Macros {
case TypedExp(_, {pos: _, def: Symbol(name)}):
propertySetExps.push(
b.call(b.symbol("set"), [b.field(name, b.symbol("this")), b.symbol(name)]));
case Symbol(name):
throw KissError.fromExp(arg, '&prop constructor argument $name must be typed');
default:
throw KissError.fromExp(arg, "invalid use of &prop in defNew");
}