-
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
Add support for clauseInterleaving in JVM generic signatures #21709
Conversation
// erased method parameters do not make it to the bytecode. | ||
def effectiveParamInfoss(t: Type)(using Context): List[List[Type]] = t match { | ||
case t: MethodType if t.hasErasedParams => | ||
t.paramInfos.zip(t.erasedParams).collect{ case (i, false) => i } |
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.
I'm not sure why the previous code here didn't just use filter
tests/run/i21346.scala
Outdated
// scalajs: --skip | ||
|
||
object Foo: | ||
def foo[X, Y, Z](x: X, y: Y)[A](z: Z) = ??? |
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.
We need to test what happens if we actually refer to A
. And perhaps also give a result type since Nothing
is a bit weird and not what we're testing for:
def foo[X, Y, Z](x: X, y: Y)[A](z: Z) = ??? | |
def foo[X, Y, Z](x: X, y: Y)[A](z: Z, A: A): (X, Y, Z, A) = ??? |
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.
Likewise, we should test what happens if the bounds of a type parameter are path-dependent on a previous term parameter.
It might not result in something very sensible, but it should be good enough not to crash Java reflection.
compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala
Outdated
Show resolved
Hide resolved
compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala
Outdated
Show resolved
Hide resolved
tests/run/i21346.scala
Outdated
def bar[X](x: X)[Y <: x.type](y: Y): (X, Y) = (x, y) | ||
|
||
@main def Test = | ||
val mtds = Foo.getClass().getDeclaredMethods().filterNot(_.getName() == "writeReplace") |
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 order of the methods is not deterministic, I'll order them alphabetically
Closes #21346