[NI] Consider intersection type with number type as Nothing
Currently, only for "in": In<in Int & A> == In<in Nothing> == In<*> #KT-37302 Fixed
This commit is contained in:
@@ -56,7 +56,13 @@ object KotlinTypeFactory {
|
||||
)
|
||||
}
|
||||
is TypeAliasDescriptor -> ErrorUtils.createErrorScope("Scope for abbreviation: ${descriptor.name}", true)
|
||||
else -> throw IllegalStateException("Unsupported classifier: $descriptor for constructor: $constructor")
|
||||
else -> {
|
||||
if (constructor is IntersectionTypeConstructor) {
|
||||
return constructor.createScopeForKotlinType()
|
||||
}
|
||||
|
||||
throw IllegalStateException("Unsupported classifier: $descriptor for constructor: $constructor")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -545,7 +545,7 @@ public class TypeUtils {
|
||||
return literalTypeConstructor.getApproximatedType();
|
||||
}
|
||||
|
||||
// If approximated type does not mathc expected type then expected type is very
|
||||
// If approximated type does not match expected type then expected type is very
|
||||
// specific type (e.g. Comparable<Byte>), so only one of possible types could match it
|
||||
KotlinType approximatedType = literalTypeConstructor.getApproximatedType();
|
||||
if (KotlinTypeChecker.DEFAULT.isSubtypeOf(approximatedType, expectedType)) {
|
||||
|
||||
Reference in New Issue
Block a user