@Override public void applyToComputationState() { if (isPackageFragment()) { return; } super.applyToComputationState(); }
@Override /* @Nullable */ protected LightweightTypeReference getSubstitutedExpectedType(int idx) { if (idx == 0 && getReceiver() != null) { return getReceiverType(); } return super.getSubstitutedExpectedType(idx); }
protected AbstractResolvedReference( Expression expression, JvmIdentifiableElement resolvedElement, ITypeExpectation expectation, ExpressionTypeComputationState state) { super(expression, expectation, state); this.resolvedElement = resolvedElement; this.typeParameterMapping = initializeTypeParameterMapping(); }
@Override protected void computeVarArgumentType(IFeatureCallArgumentSlot slot, TypeParameterSubstitutor<?> substitutor) { if (isExtension()) { List<XExpression> arguments = slot.getArgumentExpressions(); if (arguments.size() == 1) { XExpression singleArgument = arguments.get(0); if (singleArgument == getSyntacticReceiver() || singleArgument == getImplicitFirstArgument()) { computeFixedArityArgumentType(slot, substitutor); return; } } } super.computeVarArgumentType(slot, substitutor); }
@Override protected void resolveArgumentType(XExpression argument, /* @Nullable */ LightweightTypeReference declaredType, ITypeComputationState argumentState) { if (argument == getSyntacticReceiver()) { LightweightTypeReference receiverType = getSyntacticReceiverType(); if (receiverType == null) { throw new IllegalStateException("Cannot determine the receiver's type"); } resolveKnownArgumentType(argument, receiverType, declaredType, argumentState); } else if (argument == getImplicitFirstArgument()) { LightweightTypeReference argumentType = getImplicitFirstArgumentType(); if (argumentType == null) { throw new IllegalStateException("Cannot determine the implicit argument's type"); } resolveKnownArgumentType(argument, argumentType, declaredType, argumentState); } else { super.resolveArgumentType(argument, declaredType, argumentState); } }
@Override protected void resolveAgainstActualType(LightweightTypeReference declaredType, LightweightTypeReference actualType, final AbstractTypeComputationState state) { super.resolveAgainstActualType(declaredType, actualType, state); if (!isStatic() && !isExtension()) { DeferredTypeParameterHintCollector collector = new DeferredTypeParameterHintCollector(state.getReferenceOwner()); collector.processPairedReferences(declaredType, actualType); } }
return super.getDeclaredType(feature); return super.getDeclaredType(feature);