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

Compiler: fix extend from generic types #7812

Merged
merged 1 commit into from
May 24, 2019

Conversation

asterite
Copy link
Member

Fixes #7167

@asterite asterite added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:compiler:semantic labels May 22, 2019
Copy link
Member

@jhass jhass left a comment

Choose a reason for hiding this comment

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

🎉

@asterite asterite added this to the 0.29.0 milestone May 23, 2019
@jkthorne
Copy link
Contributor

I don't know if this belongs in this PR but why would parents return a nil. Seems like if all classes return an array of Types and you call parents on a class will no parents you should get an empty array.

@asterite
Copy link
Member Author

@wontruefree It's a good observation. I think I did it like that to avoid creating an empty array. But it probably makes sense to return an empty array in the default case because that will never be called, except for Object. I'll try it later (in a separate PR).

@asterite
Copy link
Member Author

Actually a module has no parents by default. I don't think I'll make this change for now.

@jkthorne
Copy link
Contributor

sounds good. I was just making an observation.

@asterite asterite merged commit 80fa597 into crystal-lang:master May 24, 2019
@asterite asterite deleted the bug/generic-extend branch May 24, 2019 01:18
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. topic:compiler:semantic
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extending a module doesn't work for generics
3 participants