User: joe Date: 11 Nov 26 20:24 Revision: 195928ff6823f8661d4dbfd014b197e99c7a7eff Summary: Fix #2661 TeamCity URL: http://ci.mcdev.io:80/viewModification.html?tab=vcsModificationFiles&modId=10714&personal=false Index: src/main/kotlin/util/psi-utils.kt =================================================================== --- src/main/kotlin/util/psi-utils.kt (revision 48ccfd1011246f9e657ffa67e54686181adf53d6) +++ src/main/kotlin/util/psi-utils.kt (revision 195928ff6823f8661d4dbfd014b197e99c7a7eff) @@ -286,12 +286,17 @@ } fun PsiType.toObjectType(project: Project): PsiType = + if (this is PsiIntersectionType) { + // erasure of an intersection type only keeps the first conjunct, which loses information + PsiIntersectionType.createIntersection(conjuncts.map { it.toObjectType(project) }) + } else { - when (val normalized = normalize()) { - is PsiPrimitiveType -> - normalized.getBoxedType(PsiManager.getInstance(project), GlobalSearchScope.allScope(project)) - ?: normalized - else -> normalized - } + when (val normalized = normalize()) { + is PsiPrimitiveType -> + normalized.getBoxedType(PsiManager.getInstance(project), GlobalSearchScope.allScope(project)) + ?: normalized + else -> normalized + } + } val PsiMethod.nameAndParameterTypes: String get() = "$name(${parameterList.parameters.joinToString(", ") { it.type.presentableText }})"