Open Sparky983 opened 5 months ago
sealed interface Click {
me.sparky983.vision.@Nullable Button button();
non-sealed interface Button extends Click {
me.sparky983.vision.Button button();
}
non-sealed interface Gui extends Click {}
}
I think this option makes more sense with type usages being Button.Click
and Gui.Click
sealed interface Click permits Button.Click, Gui.Click {
Button button();
}
non-sealed interface Button.Click extends me.sparky983.vision.Click {
@Nullable Button button();
}
non-sealed interface Gui.Click extends me.sparky983.vision.Click {}
The current
Click
API returns a non-nullButton
which would not work if we were to publish clicks of empty slots to aGui
. I'm hesitant to change it to@Nullable
since existing usages such as even in our examples:would start to produce nullable dereference warnings without a nice way to suppress it.