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

Allow nested constants in type lookup for generic arguments that resolve to integers #5532

Merged
merged 1 commit into from Jan 4, 2018
Merged

Allow nested constants in type lookup for generic arguments that resolve to integers #5532

merged 1 commit into from Jan 4, 2018

Conversation

asterite
Copy link
Member

@asterite asterite commented Jan 4, 2018

Fixes #5426

@@ -249,7 +249,7 @@ class Crystal::Type
end

# Check the case of T resolving to a number
if type_var.is_a?(Path) && type_var.names.size == 1
if type_var.is_a?(Path)
Copy link
Contributor

Choose a reason for hiding this comment

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

@asterite I'm curious, could you explain why removing this fixes the issue?

Copy link
Member Author

@asterite asterite Jan 4, 2018

Choose a reason for hiding this comment

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

Previously it worked with paths of size one (Foo, Bar, etc.), now it works with any size (Foo::Bar, Foo::Bar::Baz, etc.). The size is the number of types in the path. I don't know why I originally restricted it to one.

@RX14 RX14 added this to the Next milestone Jan 4, 2018
@RX14 RX14 merged commit d1355e7 into crystal-lang:master Jan 4, 2018
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

3 participants