[Issue 12306] Struct Enums cannot be read at compile time
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Mar 6 15:28:21 PST 2014
https://d.puremagic.com/issues/show_bug.cgi?id=12306
Vladimir Panteleev <thecybershadow at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |thecybershadow at gmail.com
--- Comment #2 from Vladimir Panteleev <thecybershadow at gmail.com> 2014-03-07 01:28:20 EET ---
Looks like the compiler parses the array declaration as an associative array
(and conservatively assumes that "point.x" is a type), then when it realizes it
is in fact a static array, it does not reparse the whole "point.x" expression
correctly (it just looks at the last symbol, x). Making it clear that it is an
expression, e.g. adding "+0", also fixes compilation.
Fixing this is not trivial as the expression that the compiler sees in the
array index is not saved. I think the correct fix would be to switch the
parsing order: Assume that the array "index" is an expression, then, if it
resolves to a type, reinterpret the whole thing as an associative array.
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list