mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-01 19:02:13 +07:00
[groovy] don't treat [] as constructor invocation if assigned to j.l.Class
This commit is contained in:
+1
@@ -142,6 +142,7 @@ public class LiteralConstructorReference extends PsiReferenceBase.Poly<GrListOrM
|
||||
private static PsiClassType filterOutTrashTypes(PsiType type) {
|
||||
if (!(type instanceof PsiClassType)) return null;
|
||||
if (type.equalsToText(CommonClassNames.JAVA_LANG_OBJECT)) return null;
|
||||
if (TypesUtil.resolvesTo(type, CommonClassNames.JAVA_LANG_CLASS)) return null;
|
||||
if (TypesUtil.resolvesTo(type, CommonClassNames.JAVA_UTIL_MAP)) return null;
|
||||
if (TypesUtil.resolvesTo(type, CommonClassNames.JAVA_UTIL_HASH_MAP)) return null;
|
||||
if (TypesUtil.resolvesTo(type, CommonClassNames.JAVA_UTIL_LIST)) return null;
|
||||
|
||||
@@ -56,7 +56,7 @@ class FooClass {
|
||||
<warning descr="Cannot assign 'Closure<Integer>' to 'Class'">c</warning> = { int a, int b -> a + b }
|
||||
<warning descr="Cannot assign 'Object' to 'Class'">c</warning> = o
|
||||
<warning descr="Cannot assign 'Matcher' to 'Class'">c</warning> = "aaa" =~ /aaa/
|
||||
c = <error descr="Constructor 'Class' in 'java.lang.Class' cannot be applied to '()'">[]</error>
|
||||
<warning descr="Cannot assign 'List' to 'Class'">c</warning> = []
|
||||
c = "java.util.List"
|
||||
c = List
|
||||
}
|
||||
@@ -82,7 +82,7 @@ class FooClass {
|
||||
Class <warning descr="Cannot assign 'Closure<Integer>' to 'Class'">c17</warning> = { int a, int b -> a + b }
|
||||
Class <warning descr="Cannot assign 'Object' to 'Class'">c18</warning> = o
|
||||
Class <warning descr="Cannot assign 'Matcher' to 'Class'">c19</warning> = "aaa" =~ /aaa/
|
||||
Class c20 = <error descr="Constructor 'Class' in 'java.lang.Class' cannot be applied to '()'">[]</error>
|
||||
Class <warning descr="Cannot assign 'List' to 'Class'">c20</warning> = []
|
||||
Class c21 = "java.util.List"
|
||||
Class c22 = List
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user