protected void resolveKnownArgumentType(XExpression argument, LightweightTypeReference knownType, /* @Nullable */ LightweightTypeReference declaredType, ITypeComputationState argumentState) { if (!(argumentState instanceof AbstractLinkingCandidate.ArgumentTypeComputationState)) throw new IllegalArgumentException("argumentState was " + argumentState); AbstractLinkingCandidate<?>.ArgumentTypeComputationState castedArgumentState = (AbstractLinkingCandidate<?>.ArgumentTypeComputationState) argumentState; ResolvedTypes resolvedTypes = getState().getResolvedTypes(); LightweightTypeReference copiedDeclaredType = declaredType != null ? declaredType.copyInto(resolvedTypes.getReferenceOwner()) : null; TypeExpectation expectation = new TypeExpectation(copiedDeclaredType, castedArgumentState, false); LightweightTypeReference copiedReceiverType = knownType.copyInto(resolvedTypes.getReferenceOwner()); // TODO should we use the result of #acceptType? int defaultFlags = castedArgumentState.getDefaultFlags(); resolvedTypes.acceptType(argument, expectation, copiedReceiverType, false, ConformanceFlags.UNCHECKED | defaultFlags); if (copiedDeclaredType != null) resolveAgainstActualType(copiedDeclaredType, copiedReceiverType, castedArgumentState); }
UnboundTypeReference casted = (UnboundTypeReference) substitutedComponentType.copyInto(first.getReferenceOwner()); List<LightweightBoundTypeArgument> hints = first.getResolvedTypes().getHints(casted.getHandle()); for(int i = 0; i < hints.size(); i++) { LightweightBoundTypeArgument hint = hints.get(i);
protected ArgumentTypeComputationState createLinkingTypeComputationState(LightweightTypeReference expectedType) { return new ArgumentTypeComputationState(state, expectedType.getLowerBoundSubstitute(), ConformanceFlags.NONE); }
protected ArgumentTypeComputationState createVarArgTypeComputationState(LightweightTypeReference componentType) { return new ArgumentTypeComputationState(state, componentType.getLowerBoundSubstitute(), ConformanceFlags.VAR_ARG); }