Introduce Type Alias: Replace type usages in constructor calls. Do not replace usages of existing type aliases

#KT-14685 Fixed
This commit is contained in:
Alexey Sedunov
2016-11-11 19:40:54 +03:00
parent 7a38dfadba
commit 0f58e2eef2
6 changed files with 84 additions and 11 deletions
@@ -333,6 +333,10 @@ class KotlinPsiUnifier(
typeRef2: KtTypeReference? = null
): Status? {
if (type1 != null && type2 != null) {
val unwrappedType1 = type1.unwrap()
val unwrappedType2 = type2.unwrap()
if (unwrappedType1 !== type1 || unwrappedType2 !== type2) return matchTypes(unwrappedType1, unwrappedType2, typeRef1, typeRef2)
if (type1.isError || type2.isError) return null
if (type1 is AbbreviatedType != type2 is AbbreviatedType) return UNMATCHED
if (type1.isExtensionFunctionType != type2.isExtensionFunctionType) return UNMATCHED