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
Should method definitions in records fail at parse time or runtime? #88
Comments
Seems like it should fail to parse? However,
would presumably have to fail at runtime, so maybe it's simpler to make them all be runtime checks? |
I agree that it would be simpler (since record syntax would just become "object literals but with different start/end tokens"), but it would be odd to allow record syntax to express a record that will always fail. |
|
Good point. I think I've been converted to thinking it should be a runtime error. I'll leave the issue open though, I'm curious if anyone else has opinions. |
I'm happy with this conclusion as a starting point, but I'd also be open to reconsidering as we get more concrete with the spec text (which is often somehow helpful in making all of this very clear). |
Either option seems reasonable to me; I personally prefer maximizing parse time errors, but committee precedent in the past has seemed to be that when some kinds of errors need to be runtime, they should all be deferred to runtime. |
Just a note for future readers. Since this was closed the spec has since been written to make method-syntax in a record a syntax-error. |
i.e.
should this fail to parse, or should this fail with an error at runtime because function objects can't be stored in Records?
The text was updated successfully, but these errors were encountered: