[Issue 23827] New: IsExpression allows Identifier outside static if/assert
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Apr 5 11:24:57 UTC 2023
https://issues.dlang.org/show_bug.cgi?id=23827
Issue ID: 23827
Summary: IsExpression allows Identifier outside static
if/assert
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: nick at geany.org
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.
--
More information about the Digitalmars-d-bugs
mailing list