rename:
getAutoCastVariantsIncludingReceiver -> getAutoCastVariants getAutoCastVariants -> getAutoCastVariantsExcludingReceiver
This commit is contained in:
@@ -828,7 +828,7 @@ public class CandidateResolver {
|
||||
) {
|
||||
ExpressionReceiver receiverToCast = new ExpressionReceiver(JetPsiUtil.safeDeparenthesize(expression, false), actualType);
|
||||
List<ReceiverValue> variants =
|
||||
AutoCastUtils.getAutoCastVariants(context.trace.getBindingContext(), context.dataFlowInfo, receiverToCast);
|
||||
AutoCastUtils.getAutoCastVariantsExcludingReceiver(context.trace.getBindingContext(), context.dataFlowInfo, receiverToCast);
|
||||
for (ReceiverValue receiverValue : variants) {
|
||||
JetType possibleType = receiverValue.getType();
|
||||
if (JetTypeChecker.INSTANCE.isSubtypeOf(possibleType, expectedType)) {
|
||||
|
||||
+6
-6
@@ -39,21 +39,21 @@ public class AutoCastUtils {
|
||||
|
||||
private AutoCastUtils() {}
|
||||
|
||||
public static List<ReceiverValue> getAutoCastVariantsIncludingReceiver(
|
||||
public static List<ReceiverValue> getAutoCastVariants(
|
||||
@NotNull ReceiverValue receiverToCast,
|
||||
@NotNull ResolutionContext context
|
||||
) {
|
||||
return getAutoCastVariantsIncludingReceiver(receiverToCast, context.trace.getBindingContext(), context.dataFlowInfo);
|
||||
return getAutoCastVariants(receiverToCast, context.trace.getBindingContext(), context.dataFlowInfo);
|
||||
}
|
||||
|
||||
public static List<ReceiverValue> getAutoCastVariantsIncludingReceiver(
|
||||
public static List<ReceiverValue> getAutoCastVariants(
|
||||
@NotNull ReceiverValue receiverToCast,
|
||||
@NotNull BindingContext bindingContext,
|
||||
@NotNull DataFlowInfo dataFlowInfo
|
||||
) {
|
||||
List<ReceiverValue> variants = Lists.newArrayList();
|
||||
variants.add(receiverToCast);
|
||||
variants.addAll(getAutoCastVariants(bindingContext, dataFlowInfo, receiverToCast));
|
||||
variants.addAll(getAutoCastVariantsExcludingReceiver(bindingContext, dataFlowInfo, receiverToCast));
|
||||
return variants;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public class AutoCastUtils {
|
||||
* @return variants @param receiverToCast may be cast to according to @param dataFlowInfo, @param receiverToCast itself is NOT included
|
||||
*/
|
||||
@NotNull
|
||||
public static List<ReceiverValue> getAutoCastVariants(
|
||||
public static List<ReceiverValue> getAutoCastVariantsExcludingReceiver(
|
||||
@NotNull BindingContext bindingContext,
|
||||
@NotNull DataFlowInfo dataFlowInfo,
|
||||
@NotNull ReceiverValue receiverToCast
|
||||
@@ -79,7 +79,7 @@ public class AutoCastUtils {
|
||||
return collectAutoCastReceiverValues(dataFlowInfo, receiver, dataFlowValue);
|
||||
}
|
||||
else if (receiverToCast instanceof AutoCastReceiver) {
|
||||
return getAutoCastVariants(bindingContext, dataFlowInfo, ((AutoCastReceiver) receiverToCast).getOriginal());
|
||||
return getAutoCastVariantsExcludingReceiver(bindingContext, dataFlowInfo, ((AutoCastReceiver) receiverToCast).getOriginal());
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
+3
-3
@@ -134,7 +134,7 @@ public class TaskPrioritizer {
|
||||
boolean resolveInvoke
|
||||
) {
|
||||
|
||||
List<ReceiverValue> variantsForExplicitReceiver = AutoCastUtils.getAutoCastVariantsIncludingReceiver(receiver, c.context);
|
||||
List<ReceiverValue> variantsForExplicitReceiver = AutoCastUtils.getAutoCastVariants(receiver, c.context);
|
||||
|
||||
//members
|
||||
for (CallableDescriptorCollector<? extends D> callableDescriptorCollector : c.callableDescriptorCollectors) {
|
||||
@@ -169,7 +169,7 @@ public class TaskPrioritizer {
|
||||
) {
|
||||
Collection<? extends D> memberExtensions = callableDescriptorCollector.getNonMembersByName(
|
||||
implicitReceiver.getType().getMemberScope(), c.name, c.context.trace);
|
||||
List<ReceiverValue> variantsForImplicitReceiver = AutoCastUtils.getAutoCastVariantsIncludingReceiver(implicitReceiver, c.context);
|
||||
List<ReceiverValue> variantsForImplicitReceiver = AutoCastUtils.getAutoCastVariants(implicitReceiver, c.context);
|
||||
c.result.addCandidates(convertWithReceivers(memberExtensions, variantsForImplicitReceiver,
|
||||
variantsForExplicitReceiver, resolveInvoke));
|
||||
}
|
||||
@@ -249,7 +249,7 @@ public class TaskPrioritizer {
|
||||
@NotNull ReceiverValue explicitReceiver,
|
||||
@NotNull TaskPrioritizerContext<D, F> c
|
||||
) {
|
||||
List<ReceiverValue> variantsForExplicitReceiver = AutoCastUtils.getAutoCastVariantsIncludingReceiver(explicitReceiver, c.context);
|
||||
List<ReceiverValue> variantsForExplicitReceiver = AutoCastUtils.getAutoCastVariants(explicitReceiver, c.context);
|
||||
|
||||
for (CallableDescriptorCollector<? extends D> callableDescriptorCollector : c.callableDescriptorCollectors) {
|
||||
addMemberExtensionCandidates(variableReceiver, variantsForExplicitReceiver, callableDescriptorCollector, c, /*resolveInvoke=*/true);
|
||||
|
||||
@@ -69,8 +69,7 @@ public final class TipsManager {
|
||||
info = DataFlowInfo.EMPTY;
|
||||
}
|
||||
|
||||
List<ReceiverValue> variantsForExplicitReceiver = AutoCastUtils.getAutoCastVariantsIncludingReceiver(
|
||||
receiverValue, context, info);
|
||||
List<ReceiverValue> variantsForExplicitReceiver = AutoCastUtils.getAutoCastVariants(receiverValue, context, info);
|
||||
|
||||
for (ReceiverValue descriptor : variantsForExplicitReceiver) {
|
||||
descriptors.addAll(includeExternalCallableExtensions(
|
||||
|
||||
Reference in New Issue
Block a user