Skip to content

Expansion of this(args) to this.apply(args) should substitute ThisType into the type signature of apply()  #6206

@scabug

Description

@scabug
class Outer {
  def apply( position : Inner ) {}
  class Inner
  apply(new Inner)
  this (new Inner) // error
}
class Outer {

  self =>

  def apply( position : Inner ) : Boolean = true

  class Inner( ) {

    def testMe = {
      self.apply( this ) // a) this works
      self( this ) // b) this does not work!
    }
  }
}

https://groups.google.com/d/msg/scala-user/U2kDHtUxZy4/ZeNGqX0Uu10J

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions