Why type specialization is defined differently than is expression type specialization ?

Steven Schveighoffer schveiguy at yahoo.com
Wed Jun 27 13:35:47 PDT 2012


On Wed, 27 Jun 2012 16:32:33 -0400, Roman D. Boiko <rb at d-coding.com> wrote:

> On Wednesday, 27 June 2012 at 20:27:39 UTC, Steven Schveighoffer wrote:
>> On Wed, 27 Jun 2012 16:16:53 -0400, Roman D. Boiko <rb at d-coding.com>  
>> wrote:
>>>> TypeSpecialization:
>>>>
>>>> Type struct union class interface enum function delegate super const  
>>>> immutable inout shared return
>>
>> This is only valid for is( Type == TypeSpecialization)
>
> No, unless the D specification is outdated.
>
> IsExpression:
> is ( Type )
> is ( Type : TypeSpecialization )
> is ( Type == TypeSpecialization )
> ...

It's poorly written, TypeSpecialization is restricted for the : case.   
Maybe it passes the parser, but fails on semantic.

"TypeSpecialization is only allowed to be a Type." -- context for is(Type  
: TypeSpecialization)

-Steve


More information about the Digitalmars-d mailing list