[Issue 24520] [REG] type(value) got a synonym (type)(value)
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Apr 29 16:31:21 UTC 2024
https://issues.dlang.org/show_bug.cgi?id=24520
Nick Treleaven <nick at geany.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |nick at geany.org
Severity|regression |normal
--- Comment #10 from Nick Treleaven <nick at geany.org> ---
> enum { A = 5};
That was allowed in https://github.com/dlang/dmd/pull/15409.
> My issue is that a silent language change with no changelog entry and no spec change
Sorry.
comment #4:
> the grammar already allowed calling a parenthesized expression
I don't think (Type) is always an expression - it is when Type is an
identifier, but not when (int) or even (int*), and this now works:
int i;
scope p = (int*)(&i);
So unless I missed some part of the grammar, I think the spec needs updating.
We can make TypeCtor optional below:
PrimaryExpression:
TypeCtor ( Type ) ( NamedArgumentListopt )
https://dlang.org/spec/expression.html#primary_expressions
--
More information about the Digitalmars-d-bugs
mailing list