NI: Add flexible Nothing to trivial constraints to filter it

This commit is contained in:
victor.petukhov
2019-12-11 16:56:12 +03:00
parent 2d5a05466d
commit 71cb65c064
7 changed files with 31 additions and 2 deletions
@@ -40,7 +40,7 @@ class TrivialConstraintTypeInferenceOracle(context: TypeSystemInferenceExtension
generatedConstraintType: KotlinTypeMarker,
isSubtype: Boolean
): Boolean {
if (isSubtype && generatedConstraintType.isNothing()) return true
if (isSubtype && (generatedConstraintType.isNothing() || generatedConstraintType.isFlexibleNothing())) return true
if (!isSubtype && generatedConstraintType.isNullableAny()) return true
// If types from constraints that will be used to generate new constraint already contains `Nothing(?)`,