mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-177330 @CompileStatic multiple assignment in variable definition should be red
This commit is contained in:
+1
-1
@@ -230,7 +230,7 @@ public abstract class GrMethodBaseImpl extends GrStubElementBase<GrMethodStub> i
|
||||
if (block != null) {
|
||||
PsiType inferred = GroovyPsiManager.inferType(method, new MethodTypeInferencer(block));
|
||||
if (inferred != null) {
|
||||
if (nominal == null || nominal.isAssignableFrom(inferred)) {
|
||||
if (nominal == null || (nominal.isAssignableFrom(inferred) && !inferred.equals(PsiType.NULL))) {
|
||||
return inferred;
|
||||
}
|
||||
}
|
||||
|
||||
+18
@@ -709,6 +709,24 @@ def foo(List list) {
|
||||
''', 'java.util.List<java.util.List>')
|
||||
}
|
||||
|
||||
void testReturnNullWithGeneric() {
|
||||
doTest('''
|
||||
import groovy.transform.CompileStatic
|
||||
|
||||
@CompileStatic
|
||||
class SomeClass {
|
||||
protected List foo(String text) {
|
||||
return null
|
||||
}
|
||||
|
||||
def bar() {
|
||||
fo<caret>o("")
|
||||
}
|
||||
}
|
||||
}
|
||||
''', 'java.util.List')
|
||||
}
|
||||
|
||||
|
||||
void testClassExpressions() {
|
||||
doExprTest 'String[]', 'java.lang.Class<java.lang.String[]>'
|
||||
|
||||
Reference in New Issue
Block a user