mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
test fix
This commit is contained in:
@@ -20,6 +20,7 @@ package standardDsls
|
||||
*/
|
||||
|
||||
final String NUMBER = "java.lang.Number"
|
||||
final String STRING = "java.lang.String"
|
||||
contributor(ctype:NUMBER) {
|
||||
method name: "plus", type: NUMBER, params:[arg:NUMBER]
|
||||
method name: "minus", type: NUMBER, params:[arg:NUMBER]
|
||||
@@ -34,4 +35,14 @@ contributor(ctype:NUMBER) {
|
||||
method name: "previous", type: psiType.canonicalText
|
||||
method name: "negative", type: psiType.canonicalText
|
||||
method name: "positive", type: psiType.canonicalText
|
||||
|
||||
method name: "plus", type: STRING, params:[arg:STRING]
|
||||
method name: "minus", type: STRING, params:[arg:STRING]
|
||||
method name: "multiply", type: STRING, params:[arg:STRING]
|
||||
method name: "power", type: STRING, params:[arg:STRING]
|
||||
method name: "div", type: STRING, params:[arg:STRING]
|
||||
method name: "mod", type: STRING, params:[arg:STRING]
|
||||
method name: "or", type: STRING, params:[arg:STRING]
|
||||
method name: "and", type: STRING, params:[arg:STRING]
|
||||
method name: "xor", type: STRING, params:[arg:STRING]
|
||||
}
|
||||
|
||||
+1
-11
@@ -76,17 +76,7 @@ public class TypesUtil {
|
||||
return JavaPsiFacade.getInstance(binaryExpression.getProject()).getElementFactory().createTypeByFQClassName(qName, scope);
|
||||
}
|
||||
|
||||
final PsiType type = getOverloadedOperatorType(lType, binaryExpression.getOperationTokenType(), binaryExpression, new PsiType[]{rType});
|
||||
if (type != null) {
|
||||
return type;
|
||||
}
|
||||
|
||||
if (typeEqualsToText(rType, GrStringUtil.GROOVY_LANG_GSTRING)) {
|
||||
PsiType gstringType = JavaPsiFacade.getInstance(binaryExpression.getProject()).getElementFactory()
|
||||
.createTypeByFQClassName(GrStringUtil.GROOVY_LANG_GSTRING, binaryExpression.getResolveScope());
|
||||
return getOverloadedOperatorType(lType, binaryExpression.getOperationTokenType(), binaryExpression, new PsiType[]{gstringType});
|
||||
}
|
||||
return null;
|
||||
return getOverloadedOperatorType(lType, binaryExpression.getOperationTokenType(), binaryExpression, new PsiType[]{rType});
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ class GroovyTransformationsTest extends LightCodeInsightFixtureTestCase {
|
||||
|
||||
public void testVetoableTransform() throws Throwable { doPlainTest() }
|
||||
|
||||
public void testNewifyTransform1() throws Throwable { doVariantsTest('newInstance', 'new', 'new',
|
||||
public void testNewifyTransform1() throws Throwable { doVariantsTest('negative', 'newInstance', 'new', 'new',
|
||||
'newInstance', 'newInstance0', 'newInstanceCallerCache', 'next') }
|
||||
|
||||
public void testNewifyTransform2() throws Throwable { doVariantsTest('Leaf', 'Leaf', 'Leaf') }
|
||||
|
||||
Reference in New Issue
Block a user