Skip to content

Commit 3242a47

Browse files
committed
Tolerate printing different on different platforms
Note that Mac agrees with Windows in printing. The compiler generated signature is the same across platforms: signature for method m = ()LTest$Foo$A<LTest$Foo<TT1;>.B$;>;
1 parent c603c87 commit 3242a47

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

tests/generic-java-signatures/derivedNames.check

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/generic-java-signatures/derivedNames.scala

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
import java.lang.reflect.ParameterizedType
2+
13
object Test {
24
def main(args: Array[String]): Unit = {
35
val objectB = classOf[Foo[Any]].getClasses
4-
val returnType = objectB(1).getDeclaredMethod("m").getGenericReturnType
5-
println(returnType)
6+
val returnType = objectB(1).getDeclaredMethod("m").getGenericReturnType.asInstanceOf[ParameterizedType]
7+
if (scala.util.isWin) assert(returnType.toString == "Test$Foo.Test$Foo$A<Test.Test$Foo<T1>.B$>")
8+
else assert(returnType.toString == "Test$Foo$A<Test$Foo<T1>$B$>")
69
}
710
class Foo[T1] {
811
class A[T2]

0 commit comments

Comments
 (0)