Mark
03/11/2023, 8:30 AMFooWrapper
(which is allowed) and FooWrapper
already extends Foo
?
sealed interface Foo
interface FooWrapper: Foo {
val wrappedFoo: Foo
}
// other module
class FooWrapperImpl(
override val wrappedFoo: Foo,
): FooWrapper, Foo by wrappedFoo // Inheritance of sealed classes or interfaces from different module is prohibited
Chris Fillmore
03/11/2023, 1:14 PMFooWrapper
as sealed, and neither would be allowed. But as it stands, FooWrapper is not sealed.Mark
03/11/2023, 1:31 PMFoo by wrappedFoo
is just there as a convenience to implement part of the FooWrapper
interface. It’s not changing what FooWrapperImpl
does or does not implement.ilya.gorbunov
03/11/2023, 4:21 PM