Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: cpovirk/RxJava
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3.x
Choose a base ref
...
head repository: cpovirk/RxJava
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: wildcard-bounds-declaration
Choose a head ref
  • 1 commit
  • 3 files changed
  • 1 contributor

Commits on May 17, 2022

  1. Declare <? super @nullable Foo> instead of <@nullable ? super Foo>.

    The latter results in runtime errors when using
    `[email protected]:strict`:
    Kotlin interprets `? super Foo` to force the callback parameters to be
    non-nullable types, apparently effectively ignoring the `@Nullable`
    part?
    
    Even if this is technically a Kotlin bug (and I don't know if it is), I
    recommend `<? super @nullable Foo>`: That is the syntax that is
    preferred [by the Checker
    Framework](https://checkerframework.org/manual/#annotations-on-wildcards)
    and by [JSpecify](https://jspecify.dev/).
    
    (In fact, I'd likewise recommend changing `class Foo<@nonnull T>` to
    `class Foo<T extends @nonnull Object>`. In that case, Kotlin handles
    both versions fine. But the latter version is better for Checker
    Framework and JSpecify. I've experimented with a version of that, and
    I'd be happy to send it as a pull request if you'd like to go that
    direction.)
    cpovirk committed May 17, 2022
    Configuration menu
    Copy the full SHA
    44fb24d View commit details
    Browse the repository at this point in the history
Loading