JVM_IR indy-SAM conversions: inline classes
KT-44278 KT-26060 KT-42621
This commit is contained in:
+11
-1
@@ -6,11 +6,21 @@ fun interface IFoo<T> {
|
||||
fun foo(x: T): T
|
||||
}
|
||||
|
||||
fun foo1(fs: IFoo<Int>) = fs.foo(1)
|
||||
fun interface IBar<T : Any> {
|
||||
fun bar(x: T): T
|
||||
}
|
||||
|
||||
|
||||
fun foo1(foo: IFoo<Int>) = foo.foo(1)
|
||||
|
||||
fun bar1(bar: IBar<Int>) = bar.bar(1)
|
||||
|
||||
fun box(): String {
|
||||
val t = foo1 { it + 41 }
|
||||
if (t != 42) return "Failed: t=$t"
|
||||
|
||||
val tt = bar1 { it + 41 }
|
||||
if (tt != 42) return "Failed: tt=$tt"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user