-
Notifications
You must be signed in to change notification settings - Fork 437
Fix RLC unsoundness with explicit @MustCallUnknown annotation
#6994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 6 commits
137224c
6b2a991
32e26b5
aae6acd
46a6d25
0a8b1b9
3ea4497
e721baf
7455157
c6e6d94
5149197
f1c4d32
1116a40
757062a
0b0d74f
43deefc
ed45a17
eeaba89
4558806
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -13,6 +13,7 @@ | |||||||||||||||||||
| import javax.lang.model.type.TypeKind; | ||||||||||||||||||||
| import javax.lang.model.type.TypeMirror; | ||||||||||||||||||||
| import javax.lang.model.util.ElementFilter; | ||||||||||||||||||||
| import org.checkerframework.checker.mustcall.qual.MustCall; | ||||||||||||||||||||
| import org.checkerframework.dataflow.analysis.RegularTransferResult; | ||||||||||||||||||||
| import org.checkerframework.dataflow.analysis.TransferInput; | ||||||||||||||||||||
| import org.checkerframework.dataflow.analysis.TransferResult; | ||||||||||||||||||||
|
|
@@ -56,7 +57,7 @@ | |||||||||||||||||||
| public class InitializationTransfer< | ||||||||||||||||||||
| V extends CFAbstractValue<V>, | ||||||||||||||||||||
| T extends InitializationTransfer<V, T, S>, | ||||||||||||||||||||
| S extends InitializationStore<V, S>> | ||||||||||||||||||||
| S extends InitializationStore<@MustCall({}) V, @MustCall({}) S>> | ||||||||||||||||||||
|
Comment on lines
59
to
+62
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Description: Show the recursive value bounds in InitializationStore and InitializationTransfer.
# Expectation after the fix: both value bounds use CFAbstractValue<@MustCall({}) V>.
rg -n -C 3 'class Initialization(Store|Transfer)|V extends CFAbstractValue' \
--iglob 'InitializationStore.java' \
--iglob 'InitializationTransfer.java'Repository: typetools/checker-framework Length of output: 2234 Align Line 62 passes Proposed fix public class InitializationTransfer<
- V extends CFAbstractValue<V>,
+ V extends CFAbstractValue<@MustCall({}) V>,
T extends InitializationTransfer<V, T, S>,
S extends InitializationStore<@MustCall({}) V, `@MustCall`({}) S>>📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||
| extends CFAbstractTransfer<V, S, T> { | ||||||||||||||||||||
|
|
||||||||||||||||||||
| protected final InitializationAnnotatedTypeFactory<?, ?, ?, ?> atypeFactory; | ||||||||||||||||||||
|
|
||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| // test case for https://github.com/typetools/checker-framework/issues/6990 | ||
|
|
||
| import java.io.Closeable; | ||
| import org.checkerframework.checker.mustcall.qual.MustCallUnknown; | ||
| import org.checkerframework.checker.mustcall.qual.Owning; | ||
|
|
||
| public class DropOwning { | ||
|
|
||
| public void f(@Owning Closeable resource) { | ||
| drop(resource); | ||
| } | ||
|
|
||
| // :: error: required.method.not.known | ||
| private void drop(@Owning @MustCallUnknown Object resourceCF6990) {} | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.