[Issue 6980] Disallow shadowing template parameters

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Dec 12 11:40:29 UTC 2023


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

Bolpat <qs.il.paperinik at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |qs.il.paperinik at gmail.com

--- Comment #2 from Bolpat <qs.il.paperinik at gmail.com> ---
The general sense of when shadowing a symbol is an error or not is if the
symbol has an unambiguous way to be referenced. This expectation is broken when
template parameters are shadowed:

```d
struct S(T)
{
    alias T = int; // no error!?
    T x;
    pragma(msg, typeof(x)); // int
}
S!double unused;
```

--


More information about the Digitalmars-d-bugs mailing list