is(this : myClass)
user1234
user1234 at 12.nl
Fri Oct 20 23:04:40 UTC 2017
On Friday, 20 October 2017 at 21:42:32 UTC, Jonathan M Davis
wrote:
> On Friday, October 20, 2017 21:32:48 Patrick via
> Digitalmars-d-learn wrote:
>> The compiler seems to reject the following code in a class
>> method:
>>
>> bool test = is(this : myClass);
>>
>> Could some please explain this?
>
> "this" is not a type.
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));
}
More information about the Digitalmars-d-learn
mailing list