Fix for KT-6106: Using platformStatic crashes intellisense (but not Compiler)
#KT-6106 Fixed
This commit is contained in:
committed by
Michael Bogdanov
parent
c50ca3ab86
commit
ea69f5a9a6
@@ -0,0 +1,28 @@
|
||||
package test
|
||||
|
||||
import kotlin.platform.platformStatic
|
||||
|
||||
open class B
|
||||
|
||||
class A {
|
||||
|
||||
class object {
|
||||
[platformStatic]
|
||||
fun <T: B> a(s: T) : T {
|
||||
return s
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val method = javaClass<A>().getDeclaredMethod("a", javaClass<B>())
|
||||
val genericParameterTypes = method.getGenericParameterTypes()
|
||||
|
||||
if (genericParameterTypes.size != 1) return "Wrong number of generic parameters"
|
||||
|
||||
if (genericParameterTypes[0].toString() != "T") return "Wrong parameter type ${genericParameterTypes[0].toString()}"
|
||||
|
||||
if (method.getGenericReturnType().toString() != "T") return "Wrong return type ${method.getGenericReturnType()}"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user