Completion for codeFragments: do not add runtime types variants if receiver type is the same as runtime type because they are already added by regular completion

This commit is contained in:
Natalia Ukhorskaya
2015-10-07 13:34:35 +03:00
parent 6fc8a16dd5
commit 7776aa77c8
@@ -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
}