|
Lines 17-23
Link Here
|
| 17 |
*******************************************************************************/ |
17 |
*******************************************************************************/ |
| 18 |
package org.eclipse.jdt.internal.compiler.ast; |
18 |
package org.eclipse.jdt.internal.compiler.ast; |
| 19 |
|
19 |
|
| 20 |
import org.eclipse.jdt.core.compiler.CharOperation; |
|
|
| 21 |
import org.eclipse.jdt.internal.compiler.ASTVisitor; |
20 |
import org.eclipse.jdt.internal.compiler.ASTVisitor; |
| 22 |
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; |
21 |
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; |
| 23 |
import org.eclipse.jdt.internal.compiler.codegen.*; |
22 |
import org.eclipse.jdt.internal.compiler.codegen.*; |
|
Lines 375-380
Link Here
|
| 375 |
} |
374 |
} |
| 376 |
if (isDiamond) { |
375 |
if (isDiamond) { |
| 377 |
TypeBinding [] inferredTypes = inferElidedTypes(((ParameterizedTypeBinding) this.resolvedType).genericType(), argumentTypes, scope); |
376 |
TypeBinding [] inferredTypes = inferElidedTypes(((ParameterizedTypeBinding) this.resolvedType).genericType(), argumentTypes, scope); |
|
|
377 |
if (inferredTypes == null) { |
| 378 |
scope.problemReporter().cannotInferElidedTypes(this); |
| 379 |
return this.resolvedType = null; |
| 380 |
} |
| 378 |
this.resolvedType = this.type.resolvedType = scope.environment().createParameterizedType(((ParameterizedTypeBinding) this.resolvedType).genericType(), inferredTypes, ((ParameterizedTypeBinding) this.resolvedType).enclosingType()); |
381 |
this.resolvedType = this.type.resolvedType = scope.environment().createParameterizedType(((ParameterizedTypeBinding) this.resolvedType).genericType(), inferredTypes, ((ParameterizedTypeBinding) this.resolvedType).enclosingType()); |
| 379 |
} |
382 |
} |
| 380 |
ReferenceBinding allocationType = (ReferenceBinding) this.resolvedType; |
383 |
ReferenceBinding allocationType = (ReferenceBinding) this.resolvedType; |
|
Lines 412-424
Link Here
|
| 412 |
if (factory instanceof ParameterizedGenericMethodBinding && factory.isValidBinding()) { |
415 |
if (factory instanceof ParameterizedGenericMethodBinding && factory.isValidBinding()) { |
| 413 |
return ((ParameterizedTypeBinding)factory.returnType).arguments; |
416 |
return ((ParameterizedTypeBinding)factory.returnType).arguments; |
| 414 |
} |
417 |
} |
| 415 |
scope.problemReporter().cannotInferElidedTypes(this); |
418 |
return null; |
| 416 |
int arity = allocationType.typeVariables().length; |
|
|
| 417 |
TypeBinding [] inferredTypes = new TypeBinding[arity]; |
| 418 |
for (int i = 0; i < arity; i++) { |
| 419 |
inferredTypes[i] = new ProblemReferenceBinding(CharOperation.NO_CHAR_CHAR, null, ProblemReasons.InferenceFailed); |
| 420 |
} |
| 421 |
return inferredTypes; |
| 422 |
} |
419 |
} |
| 423 |
|
420 |
|
| 424 |
public void setActualReceiverType(ReferenceBinding receiverType) { |
421 |
public void setActualReceiverType(ReferenceBinding receiverType) { |