mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
Support unbound callable function references in inliner
This commit is contained in:
16
compiler/testData/codegen/bytecodeText/callableReference/unboundFieldReferenceInInline.kt
vendored
Normal file
16
compiler/testData/codegen/bytecodeText/callableReference/unboundFieldReferenceInInline.kt
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
// FILE: JClass.java
|
||||
|
||||
public class JClass {
|
||||
public static int field;
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
fun box(): String {
|
||||
return if (call(10, JClass::field) == 5) "OK" else "fail"
|
||||
}
|
||||
|
||||
inline fun call(p: Int, s: () -> Int): Int {
|
||||
return s()
|
||||
}
|
||||
|
||||
// 0 NEW
|
||||
Reference in New Issue
Block a user