Relax rules about inferring to Nothing for special calls
#KT-37388 Fixed #KT-38427 Fixed #KT-39953 Fixed #KT-38899 Fixed
This commit is contained in:
+3
-3
@@ -25,11 +25,11 @@ fun <T> bind2(r: Option<T>): Option<T> {
|
||||
}
|
||||
|
||||
fun <T, R> bind3(r: Option<T>): Option<T> {
|
||||
return <!NI;TYPE_MISMATCH!>if (r is Some) {
|
||||
return if (r is Some) <!NI;TYPE_MISMATCH!>{
|
||||
// Diagnoses an error correctly
|
||||
if (true) <!OI;TYPE_MISMATCH!>None<R>()<!> else r
|
||||
}
|
||||
else r<!>
|
||||
}<!>
|
||||
else r
|
||||
}
|
||||
|
||||
fun <T> bindWhen(r: Option<T>): Option<T> {
|
||||
|
||||
Reference in New Issue
Block a user