Skip to content

Crazy infinite paths #280

Closed
Closed
@samuelgruetter

Description

@samuelgruetter

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions