Skip to content

value class restrictions should honor self type #5962

Open
@scabug

Description

trait Foo {
  self: bar.type =>
  
  final class V(val x: Int) extends AnyVal
  // ./a.scala:4: error: value class may not be a member of another class
  //   final class V(val x: Int) extends AnyVal
  //               ^
  // one error found
}

object bar extends Foo { }

This should compile, else we are robbed of all the mechanisms by which one normally can partition a large object into its constituent parts.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions