@NotNull public static JetType createUninferredParameterType( @NotNull TypeParameterDescriptor typeParameterDescriptor) { return new ErrorTypeImpl( new UninferredParameterTypeConstructor(typeParameterDescriptor), createErrorScope( "Scope for error type for not inferred parameter: " + typeParameterDescriptor.getName())); }
public static boolean containsErrorType(@NotNull FunctionDescriptor function) { if (containsErrorType(function.getReturnType())) { return true; } ReceiverParameterDescriptor receiverParameter = function.getReceiverParameter(); if (receiverParameter != null && containsErrorType(receiverParameter.getType())) { return true; } for (ValueParameterDescriptor parameter : function.getValueParameters()) { if (containsErrorType(parameter.getType())) { return true; } } for (TypeParameterDescriptor parameter : function.getTypeParameters()) { for (JetType upperBound : parameter.getUpperBounds()) { if (containsErrorType(upperBound)) { return true; } } } return false; }
public UninferredParameterTypeConstructor(@NotNull TypeParameterDescriptor descriptor) { typeParameterDescriptor = descriptor; errorTypeConstructor = createErrorTypeConstructorWithCustomDebugName( "CANT_INFER_TYPE_PARAMETER: " + descriptor.getName()); }