[Issue 24273] Circular reference error flagged in valid code
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Dec 8 19:40:55 UTC 2023
https://issues.dlang.org/show_bug.cgi?id=24273
--- Comment #2 from anonymous4 <dfj1esp02 at sneakemail.com> ---
The problem usually happens as:
alias int XVar;
struct Mst
{
XVar XVar;
}
As you can see there's an ambiguity who is who.
Usually it's possible to disambiguate with FQN:
struct Mst
{
.XVar XVar;
}
Stack variables have no FQN, so give them a different name
alias XVar XVar2;
struct Mst
{
typeof(XVar2) XVar;
}
--
More information about the Digitalmars-d-bugs
mailing list