FIR: allow lower bound of flexible type when finding contributed invoke
This commit is contained in:
committed by
TeamCityServer
parent
4a24f0fab3
commit
3bca6ae893
+7
-7
@@ -1,24 +1,24 @@
|
||||
fun test1(a: Function0<Unit>) {
|
||||
when {
|
||||
a is Runnable -> runStatic(r = a /*as Runnable */)
|
||||
a is Runnable -> runStatic(r = a /*as Runnable */ /*-> Runnable? */)
|
||||
}
|
||||
}
|
||||
|
||||
fun test2(a: Function0<Unit>) {
|
||||
when {
|
||||
a is Runnable -> J().run1(r = a /*as Runnable */)
|
||||
a is Runnable -> J().run1(r = a /*as Runnable */ /*-> Runnable? */)
|
||||
}
|
||||
}
|
||||
|
||||
fun test3(a: Function0<Unit>) {
|
||||
when {
|
||||
a is Runnable -> J().run2(r1 = a /*as Runnable */, r2 = a /*as Runnable */)
|
||||
a is Runnable -> J().run2(r1 = a /*as Runnable */ /*-> Runnable? */, r2 = a /*as Runnable */ /*-> Runnable? */)
|
||||
}
|
||||
}
|
||||
|
||||
fun test4(a: Function0<Unit>, b: Function0<Unit>) {
|
||||
when {
|
||||
a is Runnable -> J().run2(r1 = a /*as Runnable */, r2 = b /*-> Runnable? */)
|
||||
a is Runnable -> J().run2(r1 = a /*as Runnable */ /*-> Runnable? */, r2 = b /*-> Runnable? */)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ fun test5x(a: Any) {
|
||||
when {
|
||||
a is Runnable -> { // BLOCK
|
||||
a /*as Runnable */ as Function0<Unit> /*~> Unit */
|
||||
J().run1(r = a /*as Runnable */)
|
||||
J().run1(r = a /*as Runnable */ /*-> Runnable? */)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -44,11 +44,11 @@ fun test6(a: Any) {
|
||||
|
||||
fun test7(a: Function1<Int, Int>) {
|
||||
a as Function0<Unit> /*~> Unit */
|
||||
error("") /* ErrorCallExpression */a /*as Function0<Unit> */;
|
||||
J().run1(r = a /*as Function0<Unit> */ /*-> Runnable? */)
|
||||
}
|
||||
|
||||
fun test8(a: Function0<Unit>) {
|
||||
error("") /* ErrorCallExpression */id<Function0<Unit>?>(x = a);
|
||||
J().run1(r = id<Function0<Unit>?>(x = a) /*-> Runnable? */)
|
||||
}
|
||||
|
||||
fun test9() {
|
||||
|
||||
Reference in New Issue
Block a user