Community
Participate
Working Groups
v_552a I can't distinguish capture ITypeBindings by #getKey() or #isEqualTo(): The two references to 'list' below (or their respective type arguments) are equal by all measures except identity. That makes it impossible to implement correct assignment rules for our TTypes. Keys for unequal bindings from the same AST should not be equal. import java.util.List; public class Cap { List<?> list; { list.add(list.get(0)); } }
Indeed, all captures of same param types look the same. Need to improve. The difficulty is about making these binding keys convertible into binding again.
Jerome - I added 2 slots on CaptureBinding: outermostEnclosingType and position. Please leverage this info into the bindingKey and binding re-creation (find)
Changed binding key for CaptureBinding to include the outermostEnclosingType's key, the wildcard's key and the capture's position. Changed BindingKeyParser and its subclasses to handle this new format. Updated test ASTConverterTest#test0089(). Added regression test BatchASTCreationTests#test059().
Verified for 3.1 M7 using build I20050509-2010 + jdt.core HEAD. (using ASTView to verify that key binding is different for these two references to 'list'...)