Skip to content

spurious "illegal cyclic reference" in self-referring supertype #8649

@scabug

Description

@scabug

This is a regression from 2.10.4, in which the following code compiles.

Welcome to Scala version 2.11.1 (OpenJDK 64-Bit Server VM, Java 1.7.0_55).
Type in expressions to have them evaluated.
Type :help for more information.

scala> trait Cm[F[_], A]
defined trait Cm

scala> case class C[A]() extends Cm[C, A]
defined class C

scala> case class D[S,A]() extends Cm[({type l[a] = D[S,a]})#l, A]
<console>:8: error: illegal cyclic reference involving class D
       case class D[S,A]() extends Cm[({type l[a] = D[S,a]})#l, A]
                  ^
<console>:8: error: D does not take type parameters
       case class D[S,A]() extends Cm[({type l[a] = D[S,a]})#l, A]
                                                    ^

Activity

scabug

scabug commented on Jun 6, 2014

@scabug
Author

Imported From: https://issues.scala-lang.org/browse/SI-8649?orig=1
Reporter: Stephen Compall (s11001001)
Affected Versions: 2.11.1

scabug

scabug commented on Jun 6, 2014

@scabug
Author

@adriaanm said:
Workaround, for now: define it as a regular class and define the companion object manually.

added this to the Backlog milestone on Jul 18, 2019
added
fixed in Scala 3This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)
on Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixed in Scala 3This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @SethTisue@scabug

        Issue actions

          spurious "illegal cyclic reference" in self-referring supertype · Issue #8649 · scala/bug