mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-10 08:31:29 +00:00
SAM-related code in codegen was using JavaClassDescriptor directly, which has an erased signature. Create and use a new abstraction SamType which has a full generic signature of a type which was used in the SAM construct
9 lines
331 B
Kotlin
9 lines
331 B
Kotlin
import java.util.Arrays
|
|
|
|
fun box(): String {
|
|
val r: JavaClass.Computable<String> = JavaClass.Computable { "OK" }
|
|
val supertypes = Arrays.toString(r.getClass().getGenericInterfaces())
|
|
if (supertypes != "[JavaClass.JavaClass\$Computable<java.lang.String>]") return "Fail: $supertypes"
|
|
return JavaClass.compute(r)!!
|
|
}
|