[FIR] Fix local RETURN_TYPE_MISMATCH with flexible Unit and multiple Unit returns
This commit is contained in:
committed by
Space Team
parent
4b9e15dfa8
commit
b5acd1da6a
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
// FIR_IDENTICAL
|
||||
|
||||
// FILE: JavaClass.java
|
||||
|
||||
@FunctionalInterface
|
||||
public interface JavaClass<T> {
|
||||
public T invoke();
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
fun main() {
|
||||
JavaClass {
|
||||
if (true) {
|
||||
return@JavaClass
|
||||
} else {
|
||||
return@JavaClass
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// FIR_IDENTICAL
|
||||
|
||||
fun <T> execute(block: () -> T): T = block()
|
||||
|
||||
fun main() {
|
||||
execute {
|
||||
if (true) return@execute
|
||||
if (true) return@execute Unit
|
||||
execute { Any() }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user