[Issue 23733] Can't use template type parameter as type of alias parameter

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Feb 24 13:31:36 UTC 2023


https://issues.dlang.org/show_bug.cgi?id=23733

Paul Backus <snarwin+bugzilla at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|enhancement                 |normal

--- Comment #2 from Paul Backus <snarwin+bugzilla at gmail.com> ---
The spec you linked to says:

> Alias parameters can also be typed. These parameters will accept symbols of that type

...which is not "tight" at all--it places no restrictions on the type
whatsoever.

The *grammar* says that the type must be a BasicType, but the definition of
BasicType is as follows:

> BasicType:
>     FundamentalType
>     . QualifiedIdentifier
>     QualifiedIdentifier
>     Typeof
>     Typeof . QualifiedIdentifier
>     TypeCtor ( Type )
>     Vector
>     TraitsExpression
>     MixinType

Since this includes QualifiedIdentifier, Typeof, and MixinType, it also does
not place any restriction on the type used. And in any case, the example given
in this issue parses successfully.

It's possible that the type was intended to be restricted in some way, but in
that case, this is a bug in the spec. Either way, it is certainly not an
enhancement request.

--


More information about the Digitalmars-d-bugs mailing list