[FIR] Don't set lambda parameter type to Nothing by default
... when the expected type is not a function type. Instead set it to a new type variable. This fixes a bunch of false negative CANNOT_INFER_PARAMETER_TYPE. #KT-59882 Fixed
This commit is contained in:
committed by
Space Team
parent
9857bdc891
commit
c3c2f6f90a
+2
-2
@@ -38,12 +38,12 @@ FILE: kotlinSam.kt
|
||||
}
|
||||
))
|
||||
R|/foo1|(SAM(R|<local>/f|))
|
||||
R|/foo2<Inapplicable(INAPPLICABLE): /foo2>#|(<L> = foo2@fun <anonymous>(x: R|kotlin/Nothing|): R|kotlin/Boolean| <inline=Unknown> {
|
||||
R|/foo2<Inapplicable(INAPPLICABLE): /foo2>#|(<L> = foo2@fun <anonymous>(x: <ERROR TYPE REF: Cannot infer type for parameter x>): <ERROR TYPE REF: Cannot infer type variable TypeVariable(_L)> <inline=Unknown> {
|
||||
^ CMP(>, R|<local>/x|.<Unresolved name: compareTo>#(Int(1)))
|
||||
}
|
||||
)
|
||||
R|/foo2<Inapplicable(INAPPLICABLE): /foo2>#|(R|<local>/f|)
|
||||
R|/foo3<Inapplicable(INAPPLICABLE): /foo3>#|(<L> = foo3@fun <anonymous>(x: R|kotlin/Nothing|): R|kotlin/Boolean| <inline=Unknown> {
|
||||
R|/foo3<Inapplicable(INAPPLICABLE): /foo3>#|(<L> = foo3@fun <anonymous>(x: <ERROR TYPE REF: Cannot infer type for parameter x>): <ERROR TYPE REF: Cannot infer type variable TypeVariable(_L)> <inline=Unknown> {
|
||||
^ CMP(>, R|<local>/x|.<Unresolved name: compareTo>#(Int(1)))
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user