mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-11 15:53:46 +00:00
Otherwise some tools break (e.g. CheckMethodAdapter in ASM, used in generic signature writer) because they expect class names to be Java identifiers. Some tests fixed, some will be fixed in future commits
23 lines
672 B
Kotlin
23 lines
672 B
Kotlin
var _l: Any = ""
|
|
|
|
var l: Any
|
|
get() = _l
|
|
set(v) {
|
|
_l = {}
|
|
}
|
|
|
|
fun box(): String {
|
|
l = "" // to invoke the setter
|
|
|
|
val enclosingMethod = l.javaClass.getEnclosingMethod()
|
|
if (enclosingMethod?.getName() != "setL") return "method: $enclosingMethod"
|
|
|
|
val enclosingClass = l.javaClass.getEnclosingClass()!!.getName()
|
|
if (!enclosingClass.startsWith("_DefaultPackage") || !enclosingClass.contains("lambdaInPropertySetter")) return "enclosing class: $enclosingClass"
|
|
|
|
val declaringClass = l.javaClass.getDeclaringClass()
|
|
if (declaringClass != null) return "anonymous function has a declaring class: $declaringClass"
|
|
|
|
return "OK"
|
|
}
|