[Issue 17703] __traits(compiles, AssignmentExpression) no longer compiles without surrounding parens
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Thu Aug 3 12:02:30 PDT 2017
https://issues.dlang.org/show_bug.cgi?id=17703
Martin Nowak <code at dawg.eu> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |code at dawg.eu
Severity|regression |normal
--- Comment #1 from Martin Nowak <code at dawg.eu> ---
Looks like the assignment expression parsing isn't fully working, below example
works.
void works(int a, int b)
{
static assert(__traits(compiles, a = b));
}
Also the specs support the case
http://dlang.org/spec/grammar.html#TraitsArgument
I went back until 2.050 and it still wouldn't accept the code, downgrading to a
normal bug.
Simple workaround:
__traits(compiles, { exp; })
--
More information about the Digitalmars-d-bugs
mailing list