-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Regression in 1.7.0: Parser rejects valid class def syntax with whitespace after class name #12974
Comments
Caused via #12622. Which was listed as a breaking change, but still might be a regression in this particular case. Also I didn't realize you could have inlined declarations like that without using |
I think we should fix it. It works in Ruby just fine and I see no reason to disallow such syntax. |
Yeah, that breaking is not acceptable. We should probably just revert #12622 and then figure out what we can salvage from it. |
IMO such a breaking change is better than the syntax with even more exceptions. |
The thing is that there were no exceptions before. And none was needed. |
@Sija If it breaks working code, it's never better. In some cases it can be unavoidable to fix serious bugs. But in this case, it's completely avoidable. That doesn't mean that the changes from #12622 are undesired. But they're not necessary. We can postpone them, tinker with it and decide what syntax should be accepted and what not. We were expecting this to only affect obscure edge cases that are never used. No big deal. But apparently it affects real code, and that we should prevent. |
thank you, all! |
Resolved by #12977 |
Deal with compiler regression. See: crystal-lang/crystal#12974
Bug Report
I didn't see this called out in the changelog or previous issues as an intentional change, so I'm raising it as a possible compiler regression.
The following code compiles in versions of the compiler up to 1.6.2:
It no longer compiles in 1.7.x. The following does compile, as expected:
The text was updated successfully, but these errors were encountered: