Align generic signature for inner classes to work as in Java
#KT-10397 Fixed According to JVMS (p. 4.3.4) inner classes should be separated with `$` in generic signature. Note that in Java, inner types separated with `.` after first parameterized type, and now we preserve the same behaviour. See tests for clarification.
This commit is contained in:
+23
@@ -0,0 +1,23 @@
|
||||
// WITH_REFLECT
|
||||
// IGNORE_BACKEND: JS, NATIVE
|
||||
|
||||
abstract class Outer {
|
||||
|
||||
inner class FirstInner {
|
||||
inner class SecondInner<A> {
|
||||
inner class ThirdInnner {
|
||||
inner class FourthInner<B>
|
||||
|
||||
fun <C> foo(): FourthInner<C> = TODO()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
kotlin.test.assertEquals(
|
||||
"Outer\$FirstInner.Outer\$FirstInner\$SecondInner<A>.ThirdInnner.FourthInner<C>",
|
||||
Outer.FirstInner.SecondInner.ThirdInnner::class.java.declaredMethods.single().genericReturnType.toString())
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user