Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[nullsafe] Mark @nullsafe with @TypeQualifierDefault&Co for Kotlin in…
…terop Summary: Kotlin has an experimental support for [JSR-305 custom nullability qualifiers](https://github.com/Kotlin/KEEP/blob/master/proposals/jsr-305-custom-nullability-qualifiers.md). Annotating Nullsafe in a special way makes kotlinc recognize it as such custom nullability qualifier and therefore treat types coming from Nullsafe Java classes **not** as platform types, but rather proper nonnull/nullable, which affects: 1. Generated bytecode (more thorough null-checks). 2. Type inference in the IDE. NOTE re: p.1: one might expect that with properly annotated Java code Kotlin would avoid inserting runtime checks. This is not how Kotlin-Java interop works - in reality Kotlin does even more runtime checking for Java code annotated as Nonull, which IMO is a good thing, since you can't trust Java anyway. Reviewed By: mityal Differential Revision: D21278440 fbshipit-source-id: d0598738a
- Loading branch information
1 parent
c2ec55f
commit 064b478
Showing
4 changed files
with
21 additions
and
1 deletion.
There are no files selected for viewing
Binary file added
BIN
+2.61 KB
dependencies/java/kotlin-annotations/kotlin-annotations-jvm-1.3.72.jar
Binary file not shown.
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