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
Chris Fillmore
03/11/2023, 1:14 PM
You can mark
FooWrapper
as sealed, and neither would be allowed. But as it stands, FooWrapper is not sealed.
m
Mark
03/11/2023, 1:31 PM
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
ilya.gorbunov
03/11/2023, 4:21 PM
Seems reasonable to be allowed, please file an issue.