Scala Programming Language
  1. Scala Programming Language
  2. SI-5082

Compiler fails with "illegal cyclic reference involving object ..."

    Details

      Description

      Compiler fails to compile the following code:

      object Test {
      	sealed trait A
      	case object A1 extends A
      }
      
      trait Something[T]
      
      case class Test() extends Something[Test.A]
      

      However, if Test is an ordinary class, it works.

        Activity

        Hide
        Filipe Cristovao added a comment -

        I found this: https://scala-ide-portfolio.assembla.com/spaces/scala-ide/tickets/1000658-type-illegal-cyclic-reference-involving-object
        It seems to relate to the same problem. I tried to find some bug report regarding the same issue here, but haven't found any.

        Show
        Filipe Cristovao added a comment - I found this: https://scala-ide-portfolio.assembla.com/spaces/scala-ide/tickets/1000658-type-illegal-cyclic-reference-involving-object It seems to relate to the same problem. I tried to find some bug report regarding the same issue here, but haven't found any.
        Hide
        Paul Phillips added a comment -

        You're right, it's the same problem, and this ticket is very very helpful because it establishes that the addition of ProductN did not create the problem, it only exacerbated the existing one.

        Show
        Paul Phillips added a comment - You're right, it's the same problem, and this ticket is very very helpful because it establishes that the addition of ProductN did not create the problem, it only exacerbated the existing one.
        Hide
        Paul Phillips added a comment -

        Reduced.

        trait Something[T]
        object Test { class A }
        case class Test() extends Something[Test.A]
        
        Show
        Paul Phillips added a comment - Reduced. trait Something[T] object Test { class A } case class Test() extends Something[Test.A]
        Show
        Jason Zaugg added a comment - https://github.com/scala/scala/pull/1995

          People

          • Assignee:
            Jason Zaugg
            Reporter:
            Filipe Cristovao
          • Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development