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

Roman D. Boiko rb at d-coding.com
Wed Jun 27 13:40:47 PDT 2012


On Wednesday, 27 June 2012 at 20:35:47 UTC, Steven Schveighoffer 
wrote:
> On Wed, 27 Jun 2012 16:32:33 -0400, Roman D. Boiko 
> <rb at d-coding.com> wrote:
>
> 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)
>

Yeah, I found that after your post. Probably it was easier to 
implement an IsExpression in a unified way and check semantics 
separately. Otherwise it would be that IsExpression have to 
contain different types of members, if Type (not 
TypeSpecialization) in the `:` case, and the latter in the 
`TypeSpecialization` case.


More information about the Digitalmars-d mailing list