#2139 Can not override method that returns 'This'

SlimerDude Mon 6 May 2013

I would expect the following to compile but instead I get the error

Cannot return Dog as Cat This:

class Dog {
  virtual This poo() { return this }
}

class Cat : Dog {
  override This poo() { return super.poo}  
}

Is this a compiler bug?

brian Mon 6 May 2013

Promoted to ticket #2139 and assigned to brian

Yeah that looks like some boundary condition with the super expression

brian Mon 20 May 2013

Ticket resolved in 1.0.65

Add implicit conversion - changeset

SlimerDude Mon 20 May 2013

Cool... by the way, you have poo in your tests... :)

Login or Signup to reply.