public TypeBinding[] inferElidedTypes(final Scope scope) { return inferElidedTypes((ParameterizedTypeBinding) this.resolvedType, scope); } public TypeBinding[] inferElidedTypes(ParameterizedTypeBinding parameterizedType, final Scope scope) {
public TypeBinding[] inferElidedTypes(final Scope scope) { return inferElidedTypes((ParameterizedTypeBinding) this.resolvedType, scope); } public TypeBinding[] inferElidedTypes(ParameterizedTypeBinding parameterizedType, final Scope scope) {
TypeBinding [] inferredTypes = inferElidedTypes(allocationType.genericType(), enclosingType, argumentTypes, scope); if (inferredTypes == null) { return;
/** Second part of resolving that may happen multiple times during overload resolution. */ boolean resolvePart2(ResolutionState state) { // TODO: all information persisted during this method may need to be stored per targetType? if (state.isDiamond) { ReferenceBinding genericType = ((ParameterizedTypeBinding) this.resolvedType).genericType(); TypeBinding [] inferredTypes = inferElidedTypes((ParameterizedTypeBinding) this.resolvedType, this.resolvedType.enclosingType(), state.argumentTypes, state.scope); if (inferredTypes == null) { if (!state.diamondNeedsDeferring) { state.scope.problemReporter().cannotInferElidedTypes(this); state.hasReportedError = true; this.resolvedType = null; } else { state.cannotInferDiamond = true; // defer reporting } return false; } this.resolvedType = this.type.resolvedType = state.scope.environment().createParameterizedType(genericType, inferredTypes, ((ParameterizedTypeBinding) this.resolvedType).enclosingType()); state.cannotInferDiamond = false; } ReferenceBinding receiverType = (ReferenceBinding) this.resolvedType; this.binding = findConstructorBinding(state.scope, this, receiverType, state.argumentTypes); return true; }
/** Second part of resolving that may happen multiple times during overload resolution. */ boolean resolvePart2(ResolutionState state) { // TODO: all information persisted during this method may need to be stored per targetType? if (state.isDiamond) { ReferenceBinding genericType = ((ParameterizedTypeBinding) this.resolvedType).genericType(); TypeBinding [] inferredTypes = inferElidedTypes((ParameterizedTypeBinding) this.resolvedType, this.resolvedType.enclosingType(), state.argumentTypes, state.scope); if (inferredTypes == null) { if (!state.diamondNeedsDeferring) { state.scope.problemReporter().cannotInferElidedTypes(this); state.hasReportedError = true; this.resolvedType = null; } else { state.cannotInferDiamond = true; // defer reporting } return false; } this.resolvedType = this.type.resolvedType = state.scope.environment().createParameterizedType(genericType, inferredTypes, ((ParameterizedTypeBinding) this.resolvedType).enclosingType()); state.cannotInferDiamond = false; } ReferenceBinding receiverType = (ReferenceBinding) this.resolvedType; this.binding = findConstructorBinding(state.scope, this, receiverType, state.argumentTypes); return true; }
/** Second part of resolving that may happen multiple times during overload resolution. */ boolean resolvePart2(ResolutionState state) { // TODO: all information persisted during this method may need to be stored per targetType? if (state.isDiamond) { ReferenceBinding genericType = ((ParameterizedTypeBinding) this.resolvedType).genericType(); TypeBinding [] inferredTypes = inferElidedTypes((ParameterizedTypeBinding) this.resolvedType, this.resolvedType.enclosingType(), state.argumentTypes, state.scope); if (inferredTypes == null) { if (!state.diamondNeedsDeferring) { state.scope.problemReporter().cannotInferElidedTypes(this); state.hasReportedError = true; this.resolvedType = null; } else { state.cannotInferDiamond = true; // defer reporting } return false; } this.resolvedType = this.type.resolvedType = state.scope.environment().createParameterizedType(genericType, inferredTypes, ((ParameterizedTypeBinding) this.resolvedType).enclosingType()); state.cannotInferDiamond = false; } ReferenceBinding receiverType = (ReferenceBinding) this.resolvedType; this.binding = findConstructorBinding(state.scope, this, receiverType, state.argumentTypes); return true; }
inferredTypes = inferElidedTypes(scope); } finally {
inferredTypes = inferElidedTypes(allocationType, scope); } finally {
inferredTypes = inferElidedTypes(scope); } finally {
inferredTypes = inferElidedTypes(allocationType, scope); } finally {
inferredTypes = inferElidedTypes(allocationType, enclosingType, argumentTypes, scope); } finally {
inferredTypes = inferElidedTypes(scope); } finally {
inferredTypes = inferElidedTypes(allocationType, enclosingType, argumentTypes, scope); } finally {
inferredTypes = inferElidedTypes(allocationType, enclosingType, argumentTypes, scope); } finally {
TypeBinding [] inferredTypes = inferElidedTypes(((ParameterizedTypeBinding) this.resolvedType).genericType(), null, argumentTypes, scope); if (inferredTypes == null) { scope.problemReporter().cannotInferElidedTypes(this);