-
Notifications
You must be signed in to change notification settings - Fork 3
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
ast destructuring syntax more restrictive than typechecker's #116
Comments
See also eclipse-archived/ceylon#6330, which makes use of this syntax. |
Wait, why is this an |
Because it gets desugared. |
But there’s no |
What? Why would desugaring be in the spec? |
What, since when is it not the spec’s job to describe the full and complete language and everything that users can do in it? What do I care that it’s a desugaring? |
I've no idea who you're arguing with. |
You, since you seem to be saying that the |
Where on earth did I say that?! |
|
@lucaswerkmeister do you know what "desugaring" means? |
I might have misinterpreted “why would desugaring be in the spec” as “why would the spec tell you how to desugar this”, i. e. “why would sugaring be in the spec”. Not sure :D In any event… do you plan to add this syntax to the spec? Is it already there and I’m not seeing it? |
Look, none of the new destructuring functionality in 1.2.3 (in But the desugaring of a |
FTR, I don't even love this implementation strategy. I did it this way (i.e. using desugaring) only because I didn't want to impact the backends. |
This is also how I would prefer to model it in |
Many times I have argued with @FroMage that we should not implement things using desugaring because it's bad for tools. Information is lost. |
Looking into this further,
but with
Maybe, the fixes for this and eclipse-archived/ceylon#6330 are the same. |
Regarding the overall approach, it might be nice to typecheck without de-sugaring, and then have an extra de-sugaring visitor (for each feature) that can optionally be used by the backends. |
Aside from having the typechecker produce a valid Redhat AST, I don't think any of the discussed options are all that great. And I really wouldn't look forward to trying to have the Dart backend reverse engineer For my purposes, I'd be perfectly fine having the Dart backend be responsible for replacing That leaves other users of |
Besides, it might be nice for me to have code that is known to blow up the backend for use when testing error handling in tools 😄 |
The type checker allows:
where we really want
case ([String a, String b]) {...}
, but ceylon.ast throws:The text was updated successfully, but these errors were encountered: