Check if the intersecting types aren't empty during finding the result type for variable fixation
^KT-47941 Fixed
This commit is contained in:
committed by
teamcityserver
parent
3eaa452f9e
commit
93f9d9dacd
+2
-1
@@ -265,7 +265,8 @@ class ResultTypeResolver(
|
||||
* fun <T : String> materialize(): T = null as T
|
||||
* val bar: Int = materialize() // no errors, T is inferred into String & Int
|
||||
*/
|
||||
intersectTypes(upperConstraints.filterNot { it.isExpectedTypePosition() }.map { it.type })
|
||||
val filteredUpperConstraints = upperConstraints.filterNot { it.isExpectedTypePosition() }.map { it.type }
|
||||
if (filteredUpperConstraints.isNotEmpty()) intersectTypes(filteredUpperConstraints) else intersectionUpperType
|
||||
} else intersectionUpperType
|
||||
|
||||
return typeApproximator.approximateToSubType(
|
||||
|
||||
Reference in New Issue
Block a user