mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 06:05:01 +07:00
accept intersection types in casts for 1.8 (IDEA-115720)
This commit is contained in:
@@ -179,7 +179,15 @@ public class TypeConversionUtil {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else if (toType instanceof PsiIntersectionType) return false;
|
||||
else if (toType instanceof PsiIntersectionType) {
|
||||
if (fromType instanceof PsiClassType && ((PsiClassType)fromType).getLanguageLevel().isAtLeast(LanguageLevel.JDK_1_8)) {
|
||||
for (PsiType conjunct : ((PsiIntersectionType)toType).getConjuncts()) {
|
||||
if (!isNarrowingReferenceConversionAllowed(fromType, conjunct)) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if (fromType instanceof PsiDisjunctionType) {
|
||||
return isNarrowingReferenceConversionAllowed(((PsiDisjunctionType)fromType).getLeastUpperBound(), toType);
|
||||
|
||||
Reference in New Issue
Block a user