mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-91263 Incorrect type of result of '|' operator
This commit is contained in:
@@ -18,14 +18,12 @@ package standardDsls
|
||||
import com.intellij.psi.PsiType
|
||||
import com.intellij.psi.util.PsiUtil
|
||||
|
||||
import static standardDsls.Constants.NUMBER
|
||||
import static standardDsls.Constants.STRING
|
||||
/**
|
||||
* @author Maxim.Medvedev
|
||||
*/
|
||||
|
||||
private interface Constants {
|
||||
String NUMBER = "java.lang.Number"
|
||||
String STRING = "java.lang.String"
|
||||
String WILDCARD_PREFIX = "? extends "
|
||||
}
|
||||
@@ -61,22 +59,25 @@ contributor(ctype:"groovy.lang.GString") {
|
||||
delegatesTo(findClass("java.lang.String"))
|
||||
}
|
||||
|
||||
contributor(ctype:NUMBER) {
|
||||
method name: "plus", type: NUMBER, params:[arg:NUMBER]
|
||||
method name: "minus", type: NUMBER, params:[arg:NUMBER]
|
||||
method name: "multiply", type: NUMBER, params:[arg:NUMBER]
|
||||
method name: "power", type: NUMBER, params:[arg:NUMBER]
|
||||
method name: "div", type: NUMBER, params:[arg:NUMBER]
|
||||
method name: "mod", type: NUMBER, params:[arg:NUMBER]
|
||||
method name: "or", type: NUMBER, params:[arg:NUMBER]
|
||||
method name: "and", type: NUMBER, params:[arg:NUMBER]
|
||||
method name: "xor", type: NUMBER, params:[arg:NUMBER]
|
||||
method name: "next", type: removeWildcard(psiType.canonicalText)
|
||||
method name: "previous", type: removeWildcard(psiType.canonicalText)
|
||||
method name: "negative", type: removeWildcard(psiType.canonicalText)
|
||||
method name: "positive", type: removeWildcard(psiType.canonicalText)
|
||||
[Integer, Double, Float, Byte, Long, Short, Number].each {
|
||||
def className = it.canonicalName
|
||||
contributor(ctype: className) {
|
||||
method name: "plus", type: className, params: [arg: className]
|
||||
method name: "minus", type: className, params: [arg: className]
|
||||
method name: "multiply", type: className, params: [arg: className]
|
||||
method name: "power", type: className, params: [arg: className]
|
||||
method name: "div", type: className, params: [arg: className]
|
||||
method name: "mod", type: className, params: [arg: className]
|
||||
method name: "or", type: className, params: [arg: className]
|
||||
method name: "and", type: className, params: [arg: className]
|
||||
method name: "xor", type: className, params: [arg: className]
|
||||
method name: "next", type: className
|
||||
method name: "previous", type: className
|
||||
method name: "negative", type: className
|
||||
method name: "positive", type: className
|
||||
|
||||
method name: "plus", type: STRING, params:[arg:STRING]
|
||||
method name: "plus", type: STRING, params: [arg: STRING]
|
||||
}
|
||||
}
|
||||
|
||||
contributor(ctype: 'groovy.lang.MetaClass') {
|
||||
|
||||
plugins/groovy/testdata/refactoring/convertGroovyToJava/file/methodParamInClosureImplicitReturn.java
Vendored
+3
-3
@@ -10,13 +10,13 @@ return null;
|
||||
|
||||
public void foo(int x) {
|
||||
final groovy.lang.Reference<java.lang.Integer> i = new groovy.lang.Reference<java.lang.Integer>(x);
|
||||
org.codehaus.groovy.runtime.DefaultGroovyMethods.each(new java.util.ArrayList<java.lang.Integer>(java.util.Arrays.asList(1, 2, 3)), new groovy.lang.Closure<java.lang.Number>(this, this) {
|
||||
public java.lang.Number doCall(java.lang.Object it) {
|
||||
org.codehaus.groovy.runtime.DefaultGroovyMethods.each(new java.util.ArrayList<java.lang.Integer>(java.util.Arrays.asList(1, 2, 3)), new groovy.lang.Closure<java.lang.Integer>(this, this) {
|
||||
public java.lang.Integer doCall(java.lang.Object it) {
|
||||
org.codehaus.groovy.runtime.DefaultGroovyMethods.print(this, i.get());
|
||||
return setGroovyRef(i, i.get() + 1);
|
||||
}
|
||||
|
||||
public java.lang.Number doCall() {
|
||||
public java.lang.Integer doCall() {
|
||||
return doCall(null);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user