Bug 23827 – IsExpression allows Identifier outside static if/assert

Status
NEW
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2023-04-05T11:24:57Z
Last change time
2024-12-13T19:28:14Z
Keywords
pull
Assigned to
No Owner
Creator
Nick Treleaven
Moved to GitHub: dmd#18163 →

Comments

Comment #0 by nick — 2023-04-05T11:24:57Z
All 4 forms below should error: void main() { enum e = is(int Int); assert(is(int Int1 == const)); if (is(int Int2)) {} // only this is caught auto x = is(int Int3 : float); } isexpident.d(14): Error: can only declare type aliases within `static if` conditionals or `static assert`s PR incoming.
Comment #1 by dlang-bot — 2023-04-05T11:27:28Z
@ntrel created dlang/dmd pull request #15079 "Fix Issue 23827 - IsExpression allows Identifier outside static if/assert" fixing this issue: - Fix Issue 23827 - IsExpression allows Identifier outside static if/assert https://github.com/dlang/dmd/pull/15079
Comment #2 by robert.schadek — 2024-12-13T19:28:14Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18163 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB