Skip to content

Crazy infinite paths #280

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

Closed
samuelgruetter opened this issue Dec 13, 2014 · 0 comments
Closed

Crazy infinite paths #280

samuelgruetter opened this issue Dec 13, 2014 · 0 comments

Comments

@samuelgruetter
Copy link
Contributor

Converting #161 (comment) into an issue so that it doesn't get lost:

Here's a example involving infinite paths which does not yet work:

object infpaths3 {

  object a {
    trait T { t =>
      type M <: t.g.N
      type T <: a.T
      val f: t.T

      trait U { u =>
        type N <: t.f.M
        type U <: a.x.g.U
        val f: u.U
      }
      val g: t.U
    }
    val x: a.T = ???
  }

}

It detects a cycle and outputs

$ sbt "run examples/infpaths3.scala"
[error] examples/infpaths3.scala:5: error: illegal cyclic reference: upper bound T.this.g.N of type M refers back to the type itself
[error]       type M <: t.g.N
[error]              ^

but after outputting this, dotty runs into an infinite loop.

DarkDimius added a commit that referenced this issue Aug 2, 2017
tgodzik added a commit to tgodzik/scala3 that referenced this issue Apr 29, 2025
Backport "Fix regression: do not approximate prefixes when using memberType in reflect API" to 3.3 LTS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants