opprop / checker-framework-inference

Inference of pluggable types for Java
6 stars 13 forks source link

Get default type for new class tree #414

Open AndrewShf opened 1 year ago

AndrewShf commented 1 year ago

Previously, for new class tree like new @Slot1 ArrayList<String>(); the default type for slot1 was derived by visiting the identifier tree, not the new class tree. By overriding this method, the default type for slot1 now is derived by visiting the new class tree, which is a more precise context for annotating.

And I don't think we have to do anything else, like getting the default type for the type argument String in the above example, as the new method will recursively call visitParameterizedType and do corresponding things there.