typetools / typetools/checker-framework
Custom Units Checker qualifiers need to be supertypes of @UnitsBottom
@jyluo is already working on this.
Since Aug 1, 2018.
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 440
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 134
Description
Problem report: https://groups.google.com/d/msg/checker-framework-discuss/M0tPOCT9RGA/aRETL3X3CQAJ
@UnitsBottom is the implicit qualifier for null: @ImplicitFor(typeNames = Void.class, literals = LiteralKind.NULL).
For the built-in qualifiers, assigning null works, e.g. @m Float x = null;
However, for a custom units annotation, the same is not true and an error is raised:
error: [return.type.incompatible] incompatible types in return.
return null;
^
found : @UnknownUnits null
required: @frac(Prefix.deci) Float
Note that @UnitsBottom has the following meta-annotation: @SubtypeOf({}) // needs to be done programmatically
So most likely the error is that setting the correct supertypes only considered the built-in units and incorrectly ignores costum units annotations.
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.
Assessment
This issue has not been assessed yet.