-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 the tparam bounds of exported inherited classes #18647
Conversation
68905c1
to
b44edb5
Compare
6276d6e
to
640e6c8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise LGTM
640e6c8
to
b0f9e16
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes by themselves look good.
But now I wonder: what about the other uses of etaExpand? Do any of them also need as seen from?
What is the argument that we sometimes should do an asf and at other times not?
5d07e66
to
0b78b8e
Compare
@@ -1193,7 +1193,7 @@ class CompletionSuite extends BaseCompletionSuite: | |||
| val x = Bar[M](new Foo[Int]{}) | |||
| x.bar.m@@ | |||
|""".stripMargin, | |||
"""|map[B](f: A => B): Foo[B] | |||
"""|map[B](f: Int => B): Foo[B] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the test changed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we've fixed the prefix, using x.bar : Foo[Int]
instead of Foo[A]
.
0b78b8e
to
846c9c6
Compare
Sorry for not coming back to this earlier. LGTM now. This should be merged after rebase. |
When trying to export M2.F, seeing M1#F from the prefix M2 doesn't change the bounds of F's T type parameter, which still refers to M1.this.A, rather than M2.A. So, we run asSeenFrom against that info, when eta-expanding the class into a hk type lambda.
When looking at the info of the type parameters of a TypeRef, make sure to honour the reference's prefix.
846c9c6
to
c9220c2
Compare
c9220c2
to
000de84
Compare
When trying to export M2.F, seeing M1#F from the prefix M2 doesn't
change the bounds of F's T type parameter, which still refers to
M1.this.A, rather than M2.A. So, we run asSeenFrom against that info,
when eta-expanding the class into a hk type lambda.