-
Notifications
You must be signed in to change notification settings - Fork 311
Open
Labels
jspecifyRelated to support for jspecify standard (see jspecify.dev)Related to support for jspecify standard (see jspecify.dev)
Description
This will be a significant challenge in general, but maybe we can handle the common cases and do something useful without having a full technique. See here for one test case:
NullAway/nullaway/src/test/java/com/uber/nullaway/jspecify/GenericMethodTests.java
Lines 141 to 160 in 7a3d088
"package com.uber;", | |
"import org.jspecify.annotations.Nullable;", | |
"class Test {", | |
" static class Foo {", | |
" <C extends @Nullable Object> void foo(C c, Visitor<C> visitor) {", | |
" visitor.visit(this, c);", | |
" }", | |
" }", | |
" static abstract class Visitor<C extends @Nullable Object> {", | |
" abstract void visit(Foo foo, C c);", | |
" }", | |
" static class MyVisitor extends Visitor<@Nullable Void> {", | |
" @Override", | |
" void visit(Foo foo, @Nullable Void c) {}", | |
" }", | |
" static void test(Foo f) {", | |
" // this is safe", | |
" f.foo(null, new MyVisitor());", | |
" }", | |
"}") |
sbrannen
Metadata
Metadata
Assignees
Labels
jspecifyRelated to support for jspecify standard (see jspecify.dev)Related to support for jspecify standard (see jspecify.dev)