Skip to content

LMS-inspired test cases for higher-kinded types #94

Closed
@namin

Description

@namin

This compiles without error:

import scala.language.higherKinds

trait Base {
  type Rep[T]
}

trait BaseExp extends Base {
  type Rep[T] = Exp[T]
  case class Exp[T](v: T)
}

The next trait compiles with an error (which feels inadequate and the source location is lost during reporting):

trait BaseStr extends Base {
  type Rep[T] = String
}
error: right-hand side of parameterized alias type must refer to a class
one error found

The next trait compiles with the same error (though I guess it is by design here and the source location is preserved):

trait BaseDirect extends Base {
  type Rep[T] = T
}
error: right-hand side of parameterized alias type must refer to a class
  type Rep[T] = T
             ^
one error found

All these traits compile fine with Scala 2.10.3.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions