[Issue 24516] qualifiers lost when tupleof is aliased

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed May 1 23:35:51 UTC 2024


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

--- Comment #3 from basile-z <b2.temp at gmx.com> ---
(In reply to Nick Treleaven from comment #1)
> > S.tupleof
> 
> I don't think it makes sense to allow `tupleof` to be a type property. It
> should be instance only. The spec does not mention its use on a type.
> https://dlang.org/spec/class.html#tupleof
> 
> Also in dmd/typesem.d, dotExp:
> ```d
>         else if (ident == Id._tupleof)
>         {
>             if (e.isTypeExp())
>             {
>                 error(e.loc, "`.tupleof` cannot be used on type `%s`",
> mt.toChars);
>                 return ErrorExp.get();
>             }
> ```
> For some reason that is not being triggered.

The reason must be that `S` in `S.tupleof` is not a TypeExp it's a DeclExp.

--


More information about the Digitalmars-d-bugs mailing list