[Issue 15478] Constant folding inconsistency
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sat Dec 26 17:08:03 PST 2015
https://issues.dlang.org/show_bug.cgi?id=15478
ag0aep6g at gmail.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |rejects-valid
CC| |ag0aep6g at gmail.com
Hardware|x86_64 |All
OS|Linux |All
--- Comment #1 from ag0aep6g at gmail.com ---
Looks like dmd doesn't realize that it's a function call between the brackets.
Adding empty parentheses is a workaround.
Here's a slightly smaller test case that shows a different error, but I suspect
the same root cause:
----
int bug() { return 0; }
void main()
{
int[bug()] bar1; /* works */
int[bug] bar2; /* Error: index is not a type or an expression */
}
----
--
More information about the Digitalmars-d-bugs
mailing list