Add tests for KT-19511 and KT-21192 (with void -> boolean)
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
package consumer;
|
||||
|
||||
public interface Consumer<T> {
|
||||
boolean consumer(T t);
|
||||
}
|
||||
+15
@@ -61,4 +61,19 @@ fun foo8(a: Int) {
|
||||
if (a > 1) a == 10 else a == -1 // both unused
|
||||
|
||||
if (a == 10) {} else if (a == -1) {} // both used
|
||||
}
|
||||
|
||||
fun foo9() {
|
||||
consumer.Consumer<Any?> { it == null } // used
|
||||
}
|
||||
|
||||
class Test(val successCondition: (Int) -> Boolean) {
|
||||
fun pass(num: Int): Boolean = successCondition(num)
|
||||
}
|
||||
|
||||
fun foo10() {
|
||||
val t1 = Test({it == 69})
|
||||
if (t1.pass(42)) {
|
||||
//
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user