forked from typetools/checker-framework
-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
I have the following code.
import org.checkerframework.checker.determinism.qual.*;
import java.util.*;
public class C {
public @Det C myField = new @Det C(new @Det ArrayList<>());
public C(@PolyDet List<@PolyDet String> list) {
}
}In the constructor call in the field assignment, @PolyDet should be resolved to @Det, but I get an error message indicating this is not the case.
C.java:5: error: [argument.type.incompatible] incompatible argument for parameter list of C.
public @Det C myField = new @Det C(new @Det ArrayList<>());
^
found : @Det ArrayList<@PolyDet String>
required: @PolyDet List<@PolyDet String>
C.java:5: error: [argument.type.incompatible] incompatible argument for parameter list of C.
public @Det C myField = new @Det C(new @Det ArrayList<>());
^
found : @Det ArrayList<@PolyDet String>
required: @PolyDet List<@PolyDet String>
Since the parameter to the constructor call is @Det, the @PolyDet should be resolved to @Det. This doesn't seem to occur for other type systems.
Metadata
Metadata
Assignees
Labels
No labels