You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
3.18.0 produces no errors. 3.22.1 produces the following errors:
CFRepro.java:15: error: [return] incompatible types in return.
return m.computeIfAbsent(k, unused -> new Box<>(null));
^
type of expression: @Initialized @NonNull Box<@Initialized @NonNull String>
method return type: @Initialized @NonNull Box<@Initialized @Nullable String>
CFRepro.java:15: error: [argument] incompatible argument for parameter t of Box.
return m.computeIfAbsent(k, unused -> new Box<>(null));
^
found : null (NullType)
required: @Initialized @NonNull String
2 errors
Expectation
3.22.1 should behave like 3.18.0, because this code is not erroneous. We have a Map<K, Box<@Nullable V>>, and new Box(null) is s valid Box<@Nullable V>. I don't see why CF infers that new Box<>(null) has type @Initialized @NonNull Box<@Initialized @NonNull String>.
3.18.0 is an arbitary older version I happen to have handy for testing. I have not tried to identify the specific version or commit between 3.18.0 and 3.22.1 that introduced the regression.
The text was updated successfully, but these errors were encountered:
Commands
Inputs
File
CFRepro.java
:Outputs
3.18.0 produces no errors. 3.22.1 produces the following errors:
Expectation
3.22.1 should behave like 3.18.0, because this code is not erroneous. We have a
Map<K, Box<@Nullable V>>
, andnew Box(null)
is s validBox<@Nullable V>
. I don't see why CF infers thatnew Box<>(null)
has type@Initialized @NonNull Box<@Initialized @NonNull String>
.3.18.0 is an arbitary older version I happen to have handy for testing. I have not tried to identify the specific version or commit between 3.18.0 and 3.22.1 that introduced the regression.
The text was updated successfully, but these errors were encountered: