-
Notifications
You must be signed in to change notification settings - Fork 326
Open
Labels
bugjspecifyRelated to support for jspecify standard (see jspecify.dev)Related to support for jspecify standard (see jspecify.dev)
Description
Description
When using latest NullAway (0.12.15) in JSpecify mode, accessing an array element seems to misplace it, e.g. for Container<@Nullable Void>[] arr, arr[0] is wrongly treated as @Nullable.
Minimal reproducing example
package ru.snowone2026.pportnov.errorprone;
import org.jspecify.annotations.Nullable;
class NullableGenericInArray {
Container<@Nullable Void> partOf(Container<@Nullable Void>[] tasks) {
return tasks[0];
}
interface Container<T extends @Nullable Object> {
}
}Expected behaviour: successful compilation
Actual behaviour: compilation error:
NullableGenericInArray.java:6: error: [NullAway] returning @Nullable expression from method with @NonNull return type
return tasks[0];
^
(see http://t.uber.com/nullaway )
coderabbitai
Metadata
Metadata
Assignees
Labels
bugjspecifyRelated to support for jspecify standard (see jspecify.dev)Related to support for jspecify standard (see jspecify.dev)