Shouldn’t this be allowed since we are implementin...
# stdlib
m
Shouldn’t this be allowed since we are implementing
FooWrapper
(which is allowed) and
FooWrapper
already extends
Foo
?
Copy code
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
c
You can mark
FooWrapper
as sealed, and neither would be allowed. But as it stands, FooWrapper is not sealed.
m
I think the way I see it is that the
Foo 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.
i
Seems reasonable to be allowed, please file an issue.