Skip to content
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

Cyclic reference involving class Context #446

Draft
wants to merge 36 commits into
base: master
Choose a base branch
from
Draft

Cyclic reference involving class Context #446

wants to merge 36 commits into from

Conversation

b-studios
Copy link
Collaborator

@b-studios b-studios commented Apr 21, 2024

This PR is a minimalization of an incremental compilation error that we consistently hit, when modifying our Typer.scala.

(reported here: scala/scala3#20245)

Steps to reproduce:

sbt> clean
sbt> compile

Modify a line in Typer.scala

trait TyperOps extends ErrorReporter { self: Context =>
// passing `this` as ErrorReporter here is also NECESSARY for the cyclic error
private[typer] val unification = new Unification(using this)
// this export is NECESSARY for the cyclic error
export unification.{ requireSubtype }
// vvvvvvvv insert a line here, save, and run `compile` again vvvvvvvvvv
}

sbt> compile

Observed result:

[error] -- [E046] Cyclic Error: /private/tmp/effekt/effekt/shared/src/main/scala/effekt/Typer.scala:15:57
[error] 15 |  private[typer] val unification = new Unification(using this)
[error]    |                                                         ^
[error]    |                                Cyclic reference involving class Context
[error]    |
[error]    | longer explanation available when compiling with `-explain`
[error] one error found
[error] (root / Compile / compileIncremental) Compilation failed

@b-studios b-studios requested a review from dvdvgt April 21, 2024 19:12
@b-studios b-studios changed the title Bug/cycle Cyclic reference involving class Context Apr 22, 2024
@jiribenes jiribenes force-pushed the master branch 3 times, most recently from ee9d209 to 58c8510 Compare October 1, 2024 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant