Skip to content
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

Fix internal compiler error when exhaustive in-clause calls pseudo-method #10382

Merged
merged 1 commit into from
Feb 14, 2021

Conversation

HertzDevil
Copy link
Contributor

@HertzDevil HertzDevil commented Feb 10, 2021

The code

case 1
in .nil?
end

leads to an internal NilAssertionError in the parser, because no location information is attached to .nil?. Other pseudo-methods like .as and .responds_to? also trigger this, because they are not represented as Call nodes. This PR fixes this so that a proper compile-time error is reported.

Copy link
Member

@asterite asterite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@asterite asterite merged commit b4dbebd into crystal-lang:master Feb 14, 2021
@HertzDevil HertzDevil deleted the bug/when-in-location branch February 16, 2021 00:20
@bcardiff bcardiff added this to the 1.0.0 milestone Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants