Do not drop use of SAM-constructor when it's required for labeled return
This commit is contained in:
@@ -2,11 +2,21 @@ package redundantSamConstructor
|
||||
|
||||
import a.*
|
||||
|
||||
fun testNonApplicableAmbiguity() {
|
||||
fun testNonApplicableAmbiguity(p: Int) {
|
||||
GenericClassCantBeReplaced.staticFun1(JFunction0 { "" })
|
||||
GenericClassCantBeReplaced.staticFun2(JFunction0 { "" }, JFunction0 { "" })
|
||||
|
||||
val klass = GenericClassCantBeReplaced()
|
||||
klass.memberFun1(JFunction0 { "" })
|
||||
klass.memberFun2(JFunction0 { "" }, JFunction0 { "" })
|
||||
|
||||
MyJavaClass.staticFun1(Runnable {
|
||||
if (p > 0) return@Runnable
|
||||
print(1)
|
||||
})
|
||||
|
||||
MyJavaClass.staticFun2(Runnable { }, Runnable {
|
||||
if (p > 0) return@Runnable
|
||||
print(1)
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user