The error is correct. The compiler resolves the names A
and B
for full names, so what typechecker sees is:
package object cyclictest extends cyclictest.A with cyclictest.B
To verify that the package object definition is correct, the compiler must know all members A
and B
, but in order to know this, it needs to know the members of cyclictest
(since A
and B
are members of cyclictest
). However, this happens when determining the cyclicality, so you have a loop that cannot be resolved.
The first case passes because the cyclictest
package cyclictest
not inherit anything; it is a directory-based package by default.
source share