can someone explain to me why this is a compiler e...
# k2-adopters
a
can someone explain to me why this is a compiler error in pre Kotlin 2.0 versions but a warning in 2.0+? https://pl.kotl.in/IinrYXjPh 2.0+ just gives a
INFERRED_TYPE_VARIABLE_INTO_POSSIBLE_EMPTY_INTERSECTION
warning It’s worth mentioning if you specify the types explicitly, it will result in a compiler error in 2.0+, but not with inferred types đŸ¤·
d
The logic of detecting such a situation was changed between K1 and K2, so it was to hard to accurately migrate with warning all places which were green in K1 and become red in K2, but keep all red K1 places still red in K2, so it was decided to covert this error into a warning. Check KTLC-101 and KT-66196 for more info.