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

Resolve bound type parameters from generic superclass during path lookup #10839

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

HertzDevil
Copy link
Contributor

@HertzDevil HertzDevil commented Jun 21, 2021

Fixes #10834.

Also fixes part of #5243. The code

class Foo(A)
  def initialize(@value : A)
  end
end

class Bar(B) < Foo(B)
end

Bar(Int32).new(25)

will now work as long as Bar's generic arguments are provided; that is, Foo#initialize will correctly use Int32 as the restriction instead of the formal argument B. (Bar.new doesn't know that A is a free variable, so Bar.new(25) still fails.)

@straight-shoota straight-shoota added this to the 1.6.0 milestone Aug 13, 2022
@HertzDevil HertzDevil removed this from the 1.6.0 milestone Aug 13, 2022
@straight-shoota
Copy link
Member

@HertzDevil ping ⬆️

@straight-shoota straight-shoota added this to the 1.7.0 milestone Oct 27, 2022
@straight-shoota
Copy link
Member

@HertzDevil There are multiple specs failures apparently related to this change.

@straight-shoota straight-shoota removed this from the 1.7.0 milestone Oct 28, 2022
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.

Unsubstituted generic type argument can leak in generic subclass
2 participants