-
-
Notifications
You must be signed in to change notification settings - Fork 667
Open
Description
Support for an alias aggregate type member resolving to a member of a field was added in #20610. However, that only seems to work outside the aggregate type. In particular:
struct Foo
{
int v;
}
struct Bar
{
Foo f;
alias v = f.v;
void test()
{
assert(v == 3); // error, requires an instance of Foo
alias w = f.v;
w++; // error, requires an instance of Foo
}
}Walter then mentioned ambiguities and trouble: #20610 (comment)
Unless all cases like #17532 are to be supported, I'm thinking fixing #20610 just confuses things.
Edition error
Another problem is that before #20610 was fixed, I made a PR for the next edition to detect aliases like v and w and error: #15863. If the #20610 fix should stay, the edition error needs tweaking (one of the cases is still needed). I looked at allowing #20610 but for some reason an alias declaration in a function is getting a null from toParent, not a FuncDeclaration.
Metadata
Metadata
Assignees
Labels
No labels