-
-
Notifications
You must be signed in to change notification settings - Fork 670
Add unimplemented error for first-class built-ins #2240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The underlying cause is quite similar to what happens when trying to pass a class by value. On this background, a perhaps more precise error describing what's going on under the hood could be AS234, "Expression does not compile to a value at runtime". Wdyt? |
I chose the unimplemented error because it may be possible to implement first-class "proxy" functions if anyone may need such a thing, i.e. function proxy(i: u16): u8 { // generated by the compiler
return u8(i);
}
function converter<I, R>(f: (i: I) => R, i: I): R {
return f(i);
}
converter<u16, u8>(proxy, 32767); That isn't to say that it will be implemented.
|
My assumption would be that we'd eventually implement such wrappers, yeah. Basically just wrap the builtin's instruction in a function so it can be represented with a value. That would be a case for "todo" as of the quoted paragraph, though, while the idea above is rather to just use the more descriptive message of what's going on. Not feeling strongly about which one, though, mostly just my immediate thoughts. I guess ideally we'd just implement wrappers :) |
Triaging and a roadmap would help, I think. My objective for this PR and others is to fix all the crashes that I've posted as issues, at least as provisional errors, so that my AS fuzzer can catch more complex and elusive crashes that are not shadowed by trivial and common ones. |
Sounds like a good plan. I'm OK with adding the suggested error :) |
To be consistent, adding the suggested error would be, in my opinion, enough of a change to belong in a separate PR which would involve auditing all |
Thanks! Would agree that it doesn't seem pressing to add a TODO kind error just yet :) |
Fixes #2202. Another candidate for this error could be functions with
DecoratorFlags.LAZY
, but it seems that none exist.