[Issue 24482] 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 22:11:46 UTC 2024
https://issues.dlang.org/show_bug.cgi?id=24482
basile-z <b2.temp at gmx.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |b2.temp at gmx.com
Hardware|x86_64 |All
OS|Linux |All
--- Comment #1 from basile-z <b2.temp at gmx.com> ---
slightly minimized
```
struct Array(E) {}
struct Enum(T) {T t;} // <-- here T size is not known yet
alias NodeArray = Array!(Enum!(Object));
struct Object {NodeArray values;}
```
IMO the error message is correct, for example
```
struct Array(E) {}
struct Enum(T) {T t;}
alias NodeArray = Array!(Enum!(Object*));
struct Object {NodeArray values;}
```
compiles. However that's a typical case of "how forward references are handled
in D" is under-specified.
--
More information about the Digitalmars-d-bugs
mailing list