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 restriction comparison between Metaclass and Path #12523

Conversation

HertzDevil
Copy link
Contributor

@HertzDevil HertzDevil commented Sep 25, 2022

Fixes #12516.

Also orders all metaclasses before superclasses of Class, in particular Object and Value:

def foo(x : Object)
  1
end

def foo(x : Int32.class)
  2
end

# 1 before this PR
foo(Int32) # => 2

@HertzDevil HertzDevil added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:compiler:semantic kind:regression Something that used to correctly work but no longer works labels Sep 25, 2022
@HertzDevil HertzDevil changed the title Do not error when comparing metaclass restriction and undefined Path Fix restriction comparison between Metaclass and Path Sep 25, 2022
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!

@straight-shoota straight-shoota added this to the 1.6.0 milestone Sep 25, 2022
@straight-shoota straight-shoota merged commit 78fb6e0 into crystal-lang:master Sep 26, 2022
@HertzDevil HertzDevil deleted the bug/restriction-metaclass-vs-path branch September 30, 2022 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. kind:regression Something that used to correctly work but no longer works topic:compiler:semantic
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow using U/Int128 somehow broke Lucky
3 participants