fix #21630: enum and alias ignored on runtime foreach loop variables - #21631
Conversation
|
Thanks for your pull request and interest in making D better, @tgehr! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.
|
|
Looks like this breaks static RangeForeach: |
|
oops |
|
Closing in favor of #21633 |
|
I guess alternatively could remove the storage classes during the static foreach lowering. |
|
With the new patch the problem should be gone. |
I don’t know if your implementation already does that, but it would be really nice if the indicator pointed at the offending keyword ( Also, maybe give the error a supplement that says “use When your PR gets merged, you’re absolutely free to close mine. |
|
Now |
|
Hopefully the
Ideally yes, though I think this is a different issue. Note that there is already this check, that works the same way: Feel free to open a separate enhancement request to address the diagnostics quality. IIRC when I originally added the message, columns were not even tracked yet in the compiler. |
|
Still failures related to json and vcg-ast, not sure how to reproduce. I cannot really spend a lot of time on this right now, I had thought this is a quick fix. |
0b32d30 to
417bb9e
Compare
|
The failure seems unrelated: // https://issues.dlang.org/show_bug.cgi?id=3004
/*
REQUIRED_ARGS: -ignore -v
TRANSFORM_OUTPUT: remove_lines("^(predefs|binary|version|config|DFLAG|parse|import|\(imported|semantic|entry|library|function object|function core|\s*$)")
TEST_OUTPUT:
---
pragma GNU_attribute (__error)
pragma GNU_attribute (__error)
code test3004
function test3004.test
---
*/
extern(C) int printf(char*, ...);
pragma(GNU_attribute, flatten)
void test() { printf("Hello GNU world!\n".dup.ptr); }
pragma(GNU_attribute, flatten);Not sure what |
|
@dkorpel @MoonlightSentinel It seems you added the output transformation and expected output. Any idea why an unexpected |
The error is indeed unrelated and happens on stable, too: it needs the commit c9030ed currently only on master. There were some follow-up changes, too, but I think it can be cherry picked to stable. AFAICT @dkorpel will merge master to stable before the next release, so you can also rebase this on master to avoid the issue. |
Failure was introduced by e33c664. So a merge went wrong. |
|
Thanks! Rebased to master. |
|
Is master broken too? It seems for buildkite the first error is: And for DAutoTest there seem to be parser errors related to In both cases it seems unlikely that my pull request broke them. |
Did you rebase against current head? All I see in master are what look like timed out failures in Azure and GHA/FreeBSD. |
|
The chance of failure caused by this PR is not zero. And |
|
I noticed that the last buildkite run used stable as the target branch when cloning Phobos. Related PR dlang/phobos#10819 Not convinced that it introduced something, as Line 4795 in bc6dd9d |
Ah, it does matter, because #21525 |
Fixes #21630 . (Additionally adds tests for the existing checks in the analysis of
ForeachStatement.)