forked from scala/scala3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix generic signatures of generic methods
We ignored the case where a `MethodType` had another `MethodType` as result type. This commit fixes the issue by collecting the parameters of the result type if it is a `MethodType`, recursively. Fixes scala#3411
- Loading branch information
Showing
3 changed files
with
18 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
public <U> float Foo$.foo(int,java.lang.String,long,boolean,U,java.lang.String,java.lang.Object) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
object Foo { | ||
def foo[U](i: Int, s: String, x: Long)(c: Boolean, a: U, d: String)(e: Object): Float = 0.0f | ||
} | ||
|
||
object Test { | ||
def main(args: Array[String]): Unit = { | ||
val f1 = Foo.getClass.getMethods.find(_.getName.endsWith("foo")).get | ||
println(f1.toGenericString) | ||
} | ||
} |