There's a cycle in the inheritance hierarchy for this type
Copy code
class Test : Test2.Children {
sealed interface Children
}
class Test2 : Test.Children {
sealed interface Children
}
d
dmitriy.novozhilov
07/25/2024, 10:48 AM
Inside a class you can observe all nested classes/interfaces from superclasses
To achieve this compiler need to transitively resolve all supertypes of a class before starting resolution of supertypes of nested classes/interfaces
So here you have a following cycle:
1. start resolution of
Test
supertypes (
Test2.Children
)
2. before resolving supertypes of
Test2.Children
, supertypes of
Test2
should be resolved
3. start resolution of
Test.Children
supertype, its own supertypes should be resolved
4. before resolving supertypes of
Test1.Children
, supertypes of
Test1
should be resolved
5. go to 1
s
smallshen
07/26/2024, 5:14 AM
Thank you, I understand it now. Are there any solutions for this?
d
dmitriy.novozhilov
07/26/2024, 5:23 AM
You need to change the hierarchy
For example, move one of Children interfaces to top-level