[Issue 24482] New: recursive alias out of order fails to compile with a misleading error message
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Apr 4 08:35:19 UTC 2024
https://issues.dlang.org/show_bug.cgi?id=24482
Issue ID: 24482
Summary: recursive alias out of order fails to compile with a
misleading error message
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: scrubereal at gmail.com
`issue.d`:
struct Array(E) {}
struct Enum(T...) {T t;}
alias NodeArray = Array!Node;
struct Object {NodeArray values;}
alias Node = Enum!(Object);
void main() {}
`dmd issue.d` fails and gives the following messages.
issue.d(3): Error: template instance `Array!Node` recursive template
expansion
issue.d(5): Error: template instance `issue.Enum!(Object)` error
instantiating
Moving `NodeArray` below `Object` or `Node` suppresses the issue.
--
More information about the Digitalmars-d-bugs
mailing list