Mixin template parameter overloading bug?
Manfred Nowak
svv1999 at hotmail.com
Sun Jun 15 16:14:28 UTC 2025
On Sunday, 15 June 2025 at 10:51:37 UTC, Nick Treleaven wrote:
> An untyped parameter does make the literal an actual template:
> ```d
> pragma(msg, __traits(isTemplate, (x) {})); // true
> ```
> It can be instantiated with a type parameter.
Therefore in the case discussed, the code `(_){}' declares a
template. This template is used as an actual parameter to a
parameterized mixin.
If used and in general, templates must be instantiated and the
instantiatons stored for later use.
It seems, that for a parameterized mixin those actual
instantiatons are not deleted when they do not conform with the
formal parameter of the mixin.
More information about the Digitalmars-d-learn
mailing list