[NI] Fix not-null smartcast on intersection of nullable types

#KT-28670 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2018-12-06 17:47:33 +03:00
parent 383c2d1bff
commit 6ebbb6eae3
6 changed files with 48 additions and 3 deletions
@@ -142,7 +142,7 @@ internal class DataFlowInfoImpl private constructor(
private fun KotlinType.canBeDefinitelyNotNullOrNotNull(settings: LanguageVersionSettings): Boolean {
return if (settings.supportsFeature(LanguageFeature.NewInference))
this.isMarkedNullable || DefinitelyNotNullType.makesSenseToBeDefinitelyNotNull(this.unwrap())
TypeUtils.isNullableType(this)
else
this.isMarkedNullable
}