forked from typetools/checker-framework-inference
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create refinement slots for variable declarations with initialization (…
…#287) Co-authored-by: txiang61 <[email protected]>
- Loading branch information
Showing
5 changed files
with
102 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import ostrusted.qual.OsUntrusted; | ||
import ostrusted.qual.OsTrusted; | ||
|
||
public class Refinement { | ||
|
||
void foo(Object in1, Object in2) { | ||
Object o = in1; | ||
// :: fixable-error: (argument.type.incompatible) | ||
bar(o); | ||
|
||
o = in2; | ||
// :: fixable-error: (argument.type.incompatible) | ||
bar(o); | ||
} | ||
|
||
void bar(@OsTrusted Object in) {} | ||
|
||
|
||
@OsTrusted Object m(@OsUntrusted Object untrusted, Object trusted) { | ||
Object obj = untrusted; | ||
obj = trusted; | ||
// :: fixable-error: (return.type.incompatible) | ||
return obj; | ||
} | ||
} | ||
|