typetools / typetools/checker-framework
-AinvariantArrays and two-dimensional arrays
Open
Nobody has claimed this yet.
bug
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 440
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 134
Description
If I try to typecheck the following code using the -AinvariantArrays
command-line option:
public static void main(String[] args) {
assert any_null(new Object[][] { null }) == true;
}
public static boolean any_null(Object[] a) {
return true;
}
then I get the following error:
TwoDimensionalArray.java:7: error: [argument.type.incompatible] incompatible
types in argument.
assert any_null(new Object[][] { null }) == true;
^
found : Object [] []
required: Object []
1 error
A complete test case appears as
checker-framework/checker/tests/nullness-invariantarrays/TwoDimensionalArray.jav
a (currently disabled).
Original issue reported on code.google.com by michael.ernst@gmail.com on 2 Jul 2015 at 5:46
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the report with the -AinvariantArrays option and inspect checker-framework/checker/tests/nullness-invariantarrays/TwoDimensionalArray.java, which is currently disabled. Determine why the two-dimensional array argument is rejected, then make the test pass without the incompatible-types error and re-enable it if appropriate.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100