You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prior to 3.4.0, a stub file without annotations could be used to override annotations present in the corresponding classpath dependency (in the example below, the stub file for p.B#f has an implicitly non-null return type, which overrides the nullable type in the source file).
Was this change deliberate? The most likely culprit I see is 3ce0ab5. The repro doesn't use -Ainfer, and passing -AmergeStubsWithSource has no effect. If this change was deliberate, is there a way to restore the previous behaviour?
=== stubs/p.astub
package p;
import org.checkerframework.checker.nullness.qual.Nullable;
class B {
Object f();
}
=== p/B.java
package p;
import org.checkerframework.checker.nullness.qual.Nullable;
class B {
@Nullable
Object f() {
return new Object();
}
}
=== p/A.java
package p;
class A {
void f() {
System.err.println(new B().f().toString());
}
}
Compiling with p.B on the classpath, and with its corresponding stub, produces a diagnostic with 3.4.1 but not with 3.4.0:
@cushon, thanks for finding this bug and building the test case. This led me to find two related problems, which are all (hopefully) fixed (along with this one) in #3599.
Prior to
3.4.0
, a stub file without annotations could be used to override annotations present in the corresponding classpath dependency (in the example below, the stub file forp.B#f
has an implicitly non-null return type, which overrides the nullable type in the source file).Was this change deliberate? The most likely culprit I see is 3ce0ab5. The repro doesn't use
-Ainfer
, and passing-AmergeStubsWithSource
has no effect. If this change was deliberate, is there a way to restore the previous behaviour?Compiling with
p.B
on the classpath, and with its corresponding stub, produces a diagnostic with3.4.1
but not with3.4.0
:The text was updated successfully, but these errors were encountered: