mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[groovy] IDEA-221874 Disable DgmCallTypeCalculator for groovy versions >= 2.4
GitOrigin-RevId: d35e5a1752157bcc166b3a20e535338dc089a623
This commit is contained in:
committed by
intellij-monorepo-bot
parent
628624c0c8
commit
e52c715683
+1
@@ -35,6 +35,7 @@ public final class GroovyConfigUtils extends AbstractConfigUtils {
|
||||
public static final String GROOVY2_2 = "2.2";
|
||||
public static final String GROOVY2_2_2 = "2.2.2";
|
||||
public static final String GROOVY2_3 = "2.3";
|
||||
public static final String GROOVY2_4 = "2.4";
|
||||
public static final String GROOVY2_5 = "2.5";
|
||||
public static final String GROOVY3_0 = "3.0";
|
||||
|
||||
|
||||
+4
-1
@@ -1,10 +1,11 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.plugins.groovy.lang.typing
|
||||
|
||||
import com.intellij.psi.*
|
||||
import com.intellij.psi.CommonClassNames.JAVA_UTIL_COLLECTION
|
||||
import com.intellij.psi.util.InheritanceUtil.isInheritor
|
||||
import com.intellij.psi.util.PsiUtil.extractIterableTypeParameter
|
||||
import org.jetbrains.plugins.groovy.config.GroovyConfigUtils
|
||||
import org.jetbrains.plugins.groovy.lang.psi.impl.statements.expressions.CollectionUtil.createSimilarCollection
|
||||
import org.jetbrains.plugins.groovy.lang.psi.util.GroovyCommonClassNames.DEFAULT_GROOVY_METHODS
|
||||
import org.jetbrains.plugins.groovy.lang.resolve.api.Arguments
|
||||
@@ -12,6 +13,8 @@ import org.jetbrains.plugins.groovy.lang.resolve.api.Arguments
|
||||
class DgmCallTypeCalculator : GrCallTypeCalculator {
|
||||
|
||||
override fun getType(receiver: PsiType?, method: PsiMethod, arguments: Arguments?, context: PsiElement): PsiType? {
|
||||
if (GroovyConfigUtils.getInstance().isVersionAtLeast(context, GroovyConfigUtils.GROOVY2_4)) return null
|
||||
|
||||
if (arguments == null || arguments.isEmpty()) {
|
||||
return null
|
||||
}
|
||||
|
||||
+31
@@ -677,4 +677,35 @@ def m() {
|
||||
}
|
||||
'''
|
||||
}
|
||||
|
||||
void 'test IDEA-221874'() {
|
||||
testHighlighting '''
|
||||
import groovy.transform.CompileStatic
|
||||
|
||||
@CompileStatic
|
||||
def m() {
|
||||
def clazz = Thread
|
||||
clazz.declaredFields
|
||||
.findAll { !it.synthetic }
|
||||
.each {
|
||||
it.name
|
||||
}
|
||||
}
|
||||
'''
|
||||
}
|
||||
|
||||
void 'test IDEA-221874-2'() {
|
||||
testHighlighting '''
|
||||
import groovy.transform.CompileStatic
|
||||
|
||||
@CompileStatic
|
||||
def m2() {
|
||||
def all = Thread.declaredFields
|
||||
.findAll { !it.synthetic }
|
||||
|
||||
print all.<error>get</error>(0)
|
||||
}
|
||||
|
||||
''', true, false, false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user