mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[groovy] follow up IDEA-CR-17601
This commit is contained in:
+1
-5
@@ -52,9 +52,5 @@ public interface GrReferenceExpression extends GrExpression, GrReferenceElement<
|
||||
GrReferenceExpression bindToElementViaStaticImport(@NotNull PsiMember member);
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
default PsiType getType() { return getType(false); }
|
||||
|
||||
@Nullable
|
||||
PsiType getType(boolean forceRValue);
|
||||
PsiType getRValueType();
|
||||
}
|
||||
|
||||
+1
-1
@@ -189,7 +189,7 @@ public class GrAssignmentExpressionImpl extends GrOperatorExpressionImpl impleme
|
||||
lType = ((GrIndexProperty)lValue).getGetterType();
|
||||
}
|
||||
else if (lValue instanceof GrReferenceExpression) {
|
||||
lType = ((GrReferenceExpression)lValue).getType(true);
|
||||
lType = ((GrReferenceExpression)lValue).getRValueType();
|
||||
}
|
||||
else {
|
||||
lType = lValue.getType();
|
||||
|
||||
+9
-10
@@ -368,7 +368,7 @@ public class GrReferenceExpressionImpl extends GrReferenceElementImpl<GrExpressi
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static PsiType calculate(@NotNull GrReferenceExpressionImpl refExpr, boolean forceRValue) {
|
||||
private static PsiType calculateType(@NotNull GrReferenceExpressionImpl refExpr, boolean forceRValue) {
|
||||
final GroovyResolveResult[] results = refExpr.multiResolve(false, forceRValue);
|
||||
final GroovyResolveResult result = PsiImplUtil.extractUniqueResult(results);
|
||||
final PsiElement resolved = result.getElement();
|
||||
@@ -455,15 +455,14 @@ public class GrReferenceExpressionImpl extends GrReferenceElementImpl<GrExpressi
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public PsiType getType(boolean forceRValue) {
|
||||
if (forceRValue) {
|
||||
return calculate(this, true);
|
||||
}
|
||||
else {
|
||||
return TypeInferenceHelper.getCurrentContext().getExpressionType(
|
||||
this, e -> calculate(e, false)
|
||||
);
|
||||
}
|
||||
public PsiType getType() {
|
||||
return TypeInferenceHelper.getCurrentContext().getExpressionType(this, e -> calculateType(e, false));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public PsiType getRValueType() {
|
||||
return calculateType(this, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user