is(this : myClass)

Steven Schveighoffer schveiguy at yahoo.com
Fri Oct 20 23:06:57 UTC 2017


On 10/20/17 7:04 PM, user1234 wrote:
> Strangely this is not always true, in other contexts this is seen as 
> atype, although probably a bug
> 
> class Foo
> {
>      class Bar : this {}
>      static assert(is(Bar : Foo));
> }
> 

Definitely a bug. You should have to write typeof(this) (which is valid 
in this context).

-Steve


More information about the Digitalmars-d-learn mailing list