Fixed evaluation of lambda arguments of inline call + test
A lambda argument should be inlined only if it is declared as a functional type.
This commit is contained in:
committed by
Igor Chevdar
parent
295f71a29c
commit
e75a39fdd1
@@ -2101,6 +2101,11 @@ task inline_lambdaInDefaultValue(type: RunKonanTest) {
|
||||
source = "codegen/inline/lambdaInDefaultValue.kt"
|
||||
}
|
||||
|
||||
task inline_lambdaAsAny(type: RunKonanTest) {
|
||||
goldValue = "Ok\n"
|
||||
source = "codegen/inline/lambdaAsAny.kt"
|
||||
}
|
||||
|
||||
task deserialized_inline0(type: RunKonanTest) {
|
||||
source = "serialization/deserialized_inline0.kt"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package codegen.inline.lambdaAsAny
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
inline fun foo(x: Any) {
|
||||
println(if (x === x) "Ok" else "Fail")
|
||||
}
|
||||
|
||||
@Test fun runTest() {
|
||||
foo { 42 }
|
||||
}
|
||||
Reference in New Issue
Block a user