[FIR] Fix missing receiver type if anonymous function without label
This commit is contained in:
+2
-2
@@ -9,7 +9,7 @@ class None<T> : Option<T>
|
||||
fun <T> bind(r: Option<T>): Option<T> {
|
||||
return if (r is Some) {
|
||||
// Ideally we should infer Option<T> here (see KT-10896)
|
||||
(if (true) None() else r) checkType { <!UNRESOLVED_REFERENCE!>_<!><Option<T>>() }
|
||||
(if (true) None() else r) checkType { _<Option<T>>() }
|
||||
// Works correctly
|
||||
if (true) None() else r
|
||||
}
|
||||
@@ -48,7 +48,7 @@ class SimpleNone : SimpleOption
|
||||
|
||||
fun bindNoGeneric(r: SimpleOption): SimpleOption {
|
||||
return if (r is SimpleSome) {
|
||||
(if (true) SimpleNone() else r) checkType { <!UNRESOLVED_REFERENCE!>_<!><SimpleOption>() }
|
||||
(if (true) SimpleNone() else r) checkType { _<SimpleOption>() }
|
||||
if (true) SimpleNone() else r
|
||||
}
|
||||
else r
|
||||
|
||||
+4
-4
@@ -12,10 +12,10 @@ fun <T: Any> exclExcl(t: T?): T = t!!
|
||||
|
||||
fun test11() {
|
||||
// not 'String!'
|
||||
exclExcl(A.foo()) checkType { <!UNRESOLVED_REFERENCE!>_<!><String>() }
|
||||
exclExcl(A.foo()) checkType { <!UNRESOLVED_REFERENCE!>_<!><String?>() }
|
||||
exclExcl(A.foo()) checkType { _<String>() }
|
||||
exclExcl(A.foo()) checkType { <!INAPPLICABLE_CANDIDATE!>_<!><String?>() }
|
||||
|
||||
// not 'String!'
|
||||
A.foo()!! checkType { <!UNRESOLVED_REFERENCE!>_<!><String>() }
|
||||
A.foo()!! checkType { <!UNRESOLVED_REFERENCE!>_<!><String?>() }
|
||||
A.foo()!! checkType { _<String>() }
|
||||
A.foo()!! checkType { <!INAPPLICABLE_CANDIDATE!>_<!><String?>() }
|
||||
}
|
||||
Reference in New Issue
Block a user