To add on that, to ensure that the compiler doesn't go crazy when the library user creates a custom Interface
type which only conforms to BaseInterface
and types somewhere GenericType<CustomInterface>
, even though it's impossible for the user to construct it, the BaseInterface
from my point of view should be sealed.
cc @anandabits isn't that a good use-case for sealed protocols we all search for?