Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REG2.111] Indexing a *cast* AA yields no lvalue anymore #21020

Open
kinke opened this issue Mar 17, 2025 · 0 comments
Open

[REG2.111] Indexing a *cast* AA yields no lvalue anymore #21020

kinke opened this issue Mar 17, 2025 · 0 comments
Labels
Severity:Regression PRs that fix regressions

Comments

@kinke
Copy link
Contributor

kinke commented Mar 17, 2025

This works with v2.110.0, but fails to compile with v2.111.0-beta.1:

shared struct Queue
{
    int[int] map;
}

void main()
{
    auto queue = Queue();
    (cast(int[int]) queue.map)[1] = 2;
    assert(queue.map[1] == 2);
}
bug.d(9): Error: cannot modify expression `(cast(int[int])queue.map)[1]` because it is not an lvalue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Severity:Regression PRs that fix regressions
Projects
None yet
Development

No branches or pull requests

1 participant