From fe31bbdf72475cbcfec42485689d32d3c127a603 Mon Sep 17 00:00:00 2001 From: Daniil Ovchinnikov Date: Mon, 23 Jan 2017 13:26:57 +0300 Subject: [PATCH] [groovy] operator assignment: do not cache forced rValue type --- .../GrFakeReferenceExpressionElement.kt | 30 ------------------- .../GrReferenceExpressionImpl.java | 12 +++----- 2 files changed, 4 insertions(+), 38 deletions(-) delete mode 100644 plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/expressions/GrFakeReferenceExpressionElement.kt diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/expressions/GrFakeReferenceExpressionElement.kt b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/expressions/GrFakeReferenceExpressionElement.kt deleted file mode 100644 index 4398dca5fb51..000000000000 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/expressions/GrFakeReferenceExpressionElement.kt +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jetbrains.plugins.groovy.lang.psi.impl.statements.expressions - -import com.intellij.psi.impl.light.LightElement -import org.jetbrains.plugins.groovy.lang.psi.GroovyElementVisitor -import org.jetbrains.plugins.groovy.lang.psi.GroovyPsiElement - -class GrFakeReferenceExpressionElement(val original: GrReferenceExpressionImpl) - : LightElement(original.manager, original.language), GroovyPsiElement { - - override fun accept(visitor: GroovyElementVisitor?) = Unit - - override fun acceptChildren(visitor: GroovyElementVisitor?) = Unit - - override fun toString() = "fake reference expression element" -} \ No newline at end of file diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/expressions/GrReferenceExpressionImpl.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/expressions/GrReferenceExpressionImpl.java index e953addadec9..c39883fb2d3c 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/expressions/GrReferenceExpressionImpl.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/expressions/GrReferenceExpressionImpl.java @@ -78,10 +78,6 @@ public class GrReferenceExpressionImpl extends GrReferenceElementImpl new GrReferenceExpressionReference(this, true) ); - private final NotNullLazyValue myFakeGetterElement = AtomicNotNullLazyValue.createValue( - () -> new GrFakeReferenceExpressionElement(this) - ); - private final NotNullLazyValue myFakeReference = AtomicNotNullLazyValue.createValue( () -> new GrReferenceExpressionReference(this, false) ); @@ -372,7 +368,8 @@ public class GrReferenceExpressionImpl extends GrReferenceElementImpl calculate(e.getOriginal(), true) - ); + return calculate(this, true); } else { return TypeInferenceHelper.getCurrentContext().getExpressionType(