mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-51929: Passing empty list to super Groovy constructor gives wrong incompatibility warning
This commit is contained in:
+11
@@ -219,6 +219,17 @@ public class TypesUtil {
|
||||
public static boolean isAssignableByMethodCallConversion(PsiType lType, PsiType rType, PsiManager manager, GlobalSearchScope scope) {
|
||||
if (lType == null || rType == null) return false;
|
||||
|
||||
if (rType instanceof GrTupleType) {
|
||||
final GrTupleType tuple = (GrTupleType)rType;
|
||||
if (tuple.getComponentTypes().length == 0) {
|
||||
if (lType instanceof PsiArrayType ||
|
||||
InheritanceUtil.isInheritor(lType, JAVA_UTIL_LIST) ||
|
||||
InheritanceUtil.isInheritor(lType, JAVA_UTIL_SET)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (rType.equalsToText(GrStringUtil.GROOVY_LANG_GSTRING)) {
|
||||
final PsiClass javaLangString = JavaPsiFacade.getInstance(manager.getProject()).findClass(JAVA_LANG_STRING, scope);
|
||||
if (javaLangString != null &&
|
||||
|
||||
@@ -207,4 +207,6 @@ public class GroovyHighlightingTest extends LightCodeInsightFixtureTestCase {
|
||||
public void testArrayLikeAccess() throws Exception {doTest();}
|
||||
|
||||
public void testSetInitializing() throws Exception {doTest();}
|
||||
|
||||
public void testEmptyTupleAssignability() throws Exception {doTest();}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
class Foo {
|
||||
Foo(List<String> l) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class Bar extends Foo {
|
||||
def Bar() {
|
||||
super([])
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user