return ret;
}
+ // When converting a parameterized type from our world to the eclipse world, these get set so that
+ // resolution of the type parameters may known in what context it is occurring (pr114744)
+ private ReferenceBinding baseTypeForParameterizedType;
+ private int indexOfTypeParameterBeingConverted;
+
private TypeBinding makeTypeBinding1(UnresolvedType typeX) {
if (typeX.isPrimitiveType()) {
if (typeX == ResolvedType.BOOLEAN) return BaseTypes.BooleanBinding;
UnresolvedType[] typeParameters = typeX.getTypeParameters();
ReferenceBinding baseTypeBinding = lookupBinding(typeX.getBaseName());
TypeBinding[] argumentBindings = new TypeBinding[typeParameters.length];
+ baseTypeForParameterizedType = baseTypeBinding;
for (int i = 0; i < argumentBindings.length; i++) {
+ indexOfTypeParameterBeingConverted = i;
argumentBindings[i] = makeTypeBinding(typeParameters[i]);
}
+ indexOfTypeParameterBeingConverted = 0;
+ baseTypeForParameterizedType = null;
ParameterizedTypeBinding ptb =
lookupEnvironment.createParameterizedType(baseTypeBinding,argumentBindings,baseTypeBinding.enclosingType());
return ptb;
}
TypeBinding[] otherBounds = null;
if (brt.getAdditionalBounds()!=null && brt.getAdditionalBounds().length!=0) otherBounds = makeTypeBindings(brt.getAdditionalBounds());
- // FIXME asc rank should not always be 0 ...
- WildcardBinding wb = lookupEnvironment.createWildcard(null,0,bound,otherBounds,boundkind);
+ WildcardBinding wb = lookupEnvironment.createWildcard(baseTypeForParameterizedType,indexOfTypeParameterBeingConverted,bound,otherBounds,boundkind);
return wb;
} else {
return lookupBinding(typeX.getName());
public void testMatthewsAspect_pr113947_1() { runTest("maws generic aspect - 1");}
public void testMatthewsAspect_pr113947_2() { runTest("maws generic aspect - 2");}
public void testFieldGet_pr114343() { runTest("field-get, generics and around advice");}
+ public void testCaptureBinding_pr114744() { runTest("capturebinding wildcard problem");}
public void testBadDecp_pr110788_1() { runTest("bad generic decp - 1");}
public void testBadDecp_pr110788_2() { runTest("bad generic decp - 2");}
</compile>
</ajc-test>
+ <ajc-test dir="bugs150" title="capturebinding wildcard problem">
+ <compile files="pr114744.aj" options="-1.5">
+ </compile>
+ </ajc-test>
+
<ajc-test dir="bugs150/pr114343" title="field-get, generics and around advice">
<compile files="Test.java,Test1.java,Test2.java,TestAspect.aj" options="-1.5">
<message kind="warning" line="7" text="unchecked conversion when advice applied at shadow field-get(java.util.Set Test1.intsSet), expected java.util.Set<java.lang.Integer> but advice uses java.util.Set"/>