Skip to content

JSpecify: Improve assignment incompatibility error message when converting type to super #1268

@msridhar

Description

@msridhar

I've confirmed the Spring error on CI is valid:

/tmp/spring-framework/spring-beans/src/main/java/org/springframework/beans/factory/aot/DefaultBeanRegistrationCodeFragments.java:75: error: [NullAway] Cannot assign from type SingletonSupplier<InstantiationDescriptor> to type Supplier<InstantiationDescriptor> due to mismatched nullability of type parameters

This is because SingletonSupplier<T> extends Supplier<@Nullable T> (here). Though the error is valid, it's also incomprehensible; the type parameters look the same! Let me think about if we can do something better.

Originally posted by @msridhar in #1266 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    jspecifyRelated to support for jspecify standard (see jspecify.dev)

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions