-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Export+import cause Cyclic reference involving val <import>
error
#13120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I made another check, and it turns out opaque has no play here. If we change import container.ir
trait Foo extends ir.Foo
object Foo:
def bar(foo: Foo): Unit = {}
export Foo.* |
Cyclic reference involving val <import>
errorCyclic reference involving val <import>
error
For the original example where Foo is opaque, joint compilation is successful, but separate compilation produces the cyclic reference error. For the revised example without the opaque type, joint compilation fails with:
whereas separate compilation reports the same cyclic reference error as before. |
Change the sealed trait |
Confirmed. The joint compilation is successful, but compiling |
This error was very difficult to minimize.
Features that are participating: opaque types, export, and import.
In the example, if the opaque directly refers to
container.ir.Foo
there is no error.If we remove the export, there is no error.
Compiler version
3.0.3-RC1-bin-20210716-cc47c56-NIGHTLY
Minimized code
Minimized project at: https://github.com/soronpo/dottybug/tree/export_cyclic_err
container.scala
Foo.scala
Output
Expectation
No error.
The text was updated successfully, but these errors were encountered: