Skip to content

Commit 0949860

Browse files
authored
Merge pull request #3414 from Duhemm/fix/i3411
Fix generic signatures of generic methods
2 parents bef7084 + 0b2f315 commit 0949860

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,8 @@ object GenericSignatures {
240240

241241
case mtpe: MethodType =>
242242
// phantom method parameters do not make it to the bytecode.
243-
val params = mtpe.paramInfos.filterNot(_.isPhantom)
244-
val restpe = mtpe.resultType
243+
val params = mtpe.paramInfoss.flatten.filterNot(_.isPhantom)
244+
val restpe = mtpe.finalResultType
245245
builder.append('(')
246246
// TODO: Update once we support varargs
247247
params.foreach { tp =>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
public <U> float Foo$.foo(int,java.lang.String,long,boolean,U,java.lang.String,java.lang.Object)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
object Foo {
2+
def foo[U](i: Int, s: String, x: Long)(c: Boolean, a: U, d: String)(e: Object): Float = 0.0f
3+
}
4+
5+
object Test {
6+
def main(args: Array[String]): Unit = {
7+
val f1 = Foo.getClass.getMethods.find(_.getName.endsWith("foo")).get
8+
println(f1.toGenericString)
9+
}
10+
}

0 commit comments

Comments
 (0)