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

Abstract type member instantiation causes illegal cyclic reference compile error #11560

Open
odipar opened this issue Jun 6, 2019 · 3 comments

Comments

Projects
None yet
2 participants
@odipar
Copy link

commented Jun 6, 2019

The following code doesn't compile and cause 'illegal cyclic reference' compile error

object IllegalCyclicReference {

  trait Problem {
    def x: X

    // If we uncomment below , we get the compiler error "illegal cyclic reference" ????
    // def z = x.z
  }

  trait Y[S]

  trait X {
    type S = Z

    trait Z extends Y[S]

    def z: Z
  }
}

See also ScalaFiddle: https://scalafiddle.io/sf/zuBKhBy/5

@odipar

This comment has been minimized.

Copy link
Author

commented Jun 6, 2019

All major scala compiler (2.10, 2.11, 2.12) versions cause the error except Dotty.

@odipar

This comment has been minimized.

Copy link
Author

commented Jun 6, 2019

I see the label 'fixed in Dotty' but is it really 'fixed'?

It could well be that my construction is invalid and the none-Dotty compilers are correct...

@odipar

This comment has been minimized.

Copy link
Author

commented Jun 6, 2019

non-Dotty == scala 2.x.y

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.