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

Refactor restriction mechanism for autocasting #12014

Merged

Conversation

HertzDevil
Copy link
Contributor

Factors out some of the common code between number and symbol autocasting, which hopefully makes it a bit easier to define new autocasts, e.g. these two.

The first PR is extracted from #10701. (It went stale because it happened before support for number-typed variables was added.)

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.

This is great, thank you!

@beta-ziliani
Copy link
Member

The failing checks is because it's not compatible with 1.0 (Hash#subset_of was introduced in 1.1). For the moment there's no need to take action.

@Sija
Copy link
Contributor

Sija commented Apr 20, 2022

@beta-ziliani Code in questions calls (IntegerType | FloatType)#subset_of?, not Hash#subset_of?

@straight-shoota straight-shoota added this to the 1.5.0 milestone Apr 21, 2022
@straight-shoota straight-shoota merged commit 57caede into crystal-lang:master Apr 27, 2022
@HertzDevil HertzDevil deleted the refactor/autocast-partial-match branch April 28, 2022 09:09
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.

5 participants