diff --git a/idea/ide-common/src/org/jetbrains/kotlin/idea/codeInsight/ReferenceVariantsHelper.kt b/idea/ide-common/src/org/jetbrains/kotlin/idea/codeInsight/ReferenceVariantsHelper.kt index a5d7d96aebf..7db2b98e9fe 100644 --- a/idea/ide-common/src/org/jetbrains/kotlin/idea/codeInsight/ReferenceVariantsHelper.kt +++ b/idea/ide-common/src/org/jetbrains/kotlin/idea/codeInsight/ReferenceVariantsHelper.kt @@ -320,7 +320,9 @@ public class ReferenceVariantsHelper( val type = context.getType(receiver) if (type != null && TypeUtils.canHaveSubtypes(JetTypeChecker.DEFAULT, type)) { val evaluator = receiver.getContainingFile().getCopyableUserData(JetCodeFragment.RUNTIME_TYPE_EVALUATOR) - return evaluator?.invoke(receiver) + val runtimeType = evaluator?.invoke(receiver) + if (runtimeType == type) return null + return runtimeType } return type }