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

WIP - Fix #9176: fast check of cyclic object initialization #11913

Closed
wants to merge 4 commits into from

Conversation

liufengyun
Copy link
Contributor

Fix #9176: fast check of cyclic object initialization

Given the following program

class Foo(val opposite: Foo)
case object A extends Foo(B)     // error
case object B extends Foo(A)     // error

It reports:

-- Warning: tests/init/neg/i9176.scala:2:0 -------------------------------------
2 |case object A extends Foo(B)     // error
  |^
  |Cylic object dependencies detected. Cyclic path:
  | -> case object A extends Foo(B)     // error	[ i9176.scala:2 ]
  |  -> case object B extends Foo(A)     // error	[ i9176.scala:3 ]
-- Warning: tests/init/neg/i9176.scala:3:0 -------------------------------------
3 |case object B extends Foo(A)     // error
  |^
  |Cylic object dependencies detected. Cyclic path:
  | -> case object B extends Foo(A)     // error	[ i9176.scala:3 ]
  |  -> case object A extends Foo(B)     // error	[ i9176.scala:2 ]
2 warnings found

This PR supersedes #10550 for being simpler and faster.

@liufengyun
Copy link
Contributor Author

Superseded by #12122

@liufengyun liufengyun closed this Apr 16, 2021
@liufengyun liufengyun deleted the fix-global branch April 16, 2021 15:06
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.

Initialization checker doesn't catch uninitialized object call
1 participant