Skip to content

abstract types lose their prefix #6161

@scabug

Description

@scabug

If I change the definition of encode in Names to def encode: Name with ThisNameType then this compiles, which should make it definitive that this is a bug given that ThisNameType <: Name.

trait Namers {
  val global: scala.tools.nsc.Global
  import global.{ Name, Symbol }

  // Relevant definitions in Names
  //
  // def encode: ThisNameType
  // type ThisNameType >: Null <: Name
  //
  def f(x: Symbol): Name = x.name.encode

  /**
  b.scala:5: error: type mismatch;
   found   : Name.this.ThisNameType
   required: Namers.this.global.Name
    def f(x: Symbol): Name = x.name.encode
                                    ^
  one error found
  **/
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions