[Issue 6980] Disallow shadowing template parameters

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Dec 13 10:44:09 UTC 2023


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

Basile-z <b2.temp at gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid
                 CC|                            |b2.temp at gmx.com
           Hardware|Other                       |All
                 OS|Windows                     |All

--- Comment #3 from Basile-z <b2.temp at gmx.com> ---
This is a bug given that you cant select the first definition.

However, this should works when T is an alias template parameter and that T is
either a function or an overload set. 

That is not the case now:

```d
struct S(alias T)
{
    alias T = (int) => 0;

    void test()
    {
        T(0.1); // Error: function literal `__lambda3(int __param_0)` is not
callable 
                // using argument types `(double)`

        T(1);
    }
}

void main(string[] args)
{
    S!((float) => 0) s1;
} 
```

--


More information about the Digitalmars-d-bugs mailing list