Skip to content

Compiler crash when using package private modifiers and abstract types. #4559

@scabug

Description

@scabug

The following code compiles under Scala-2.8.1.final but causes the compiler to crash under Scala-2.9.0.RC4.

package mypkg {

  trait M { type C <: M }
  trait F extends M { type C = F }

  // requires private[mypkg] to reproduce
  private[mypkg] abstract class Private[E <: M] {
    type Sub <: Private[E#C]
    final val sub: Sub = null.asInstanceOf[Sub]

    def foo: E
  }

  trait Public[E <: M] extends Private[E] {
    type Sub = Public[E#C]
  }
}

import mypkg._

object Test {
  val seq = null.asInstanceOf[Public[F]]
  seq.sub.foo
}

The only workaround I can think of is to strip all the package private modifiers. Of course that would expose internal implementation as public API.

=== Versions ===

  • Scala: 2.9.0.RC4
  • Java: 1.6.0_u24
  • Operating system: GNU/Linux 2.6.38

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions