[Issue 21282] New: mixin of AliasSeq "cannot alias an expression"

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Sep 29 00:02:20 UTC 2020


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

          Issue ID: 21282
           Summary: mixin of AliasSeq "cannot alias an expression"
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: destructionator at gmail.com

---
template I(T...) { alias I = T; }

template Bug(T...) {
        alias Bug = mixin("I!(T[0])");
}
void func() {}
pragma(msg, Bug!func);
---

bugr.d(4): Error: alias bugr.Bug!(func).Bug cannot alias an expression
tuple(func)
bugr.d(7): Error: template instance bugr.Bug!(func) error instantiating
bugr.d(7):        while evaluating pragma(msg, Bug!(func))


If you remove the `mixin` it works, so it isn't a fundamental limitation,
something is lost through the mixin layer.


This was broken in this version: https://dlang.org/changelog/2.089.1.html

My gut suspicion is it has to do with the fix to
https://issues.dlang.org/show_bug.cgi?id=20431 but I don't actually know.

--


More information about the Digitalmars-d-bugs mailing list