[Issue 22969] New: Can't mixin name of manifest constant on right-hand side of alias declaration
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Apr 2 19:53:04 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=22969
Issue ID: 22969
Summary: Can't mixin name of manifest constant on right-hand
side of alias declaration
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: snarwin+bugzilla at gmail.com
As of DMD 2.099.0, the following program fails to compile:
---
enum e = 0;
alias a = mixin("e");
---
The error message is:
---
onlineapp.d(2): Error: alias `onlineapp.a` cannot alias an expression `0`
---
If the manifest constant is changed to a variable, compilation succeeds:
---
auto v = 0;
alias a = mixin("v"); // ok
---
--
More information about the Digitalmars-d-bugs
mailing list