[Issue 14978] Improve incorrect AA declaration error message
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Oct 10 09:11:33 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=14978
RazvanN <razvan.nitu1305 at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |razvan.nitu1305 at gmail.com
Resolution|--- |WONTFIX
--- Comment #1 from RazvanN <razvan.nitu1305 at gmail.com> ---
Unfortunately, I don't think this can be fixed. Once you have `()` the compiler
expects an expression. If you have a type, it simply treats the expression as a
cast. However, the parser does not exactly if you have a type or not inside the
params, it just checks what's next after `)`. I tried fixing it by checking
whether after `)` we have a left bracket (`[`) [1], but that is not enough,
because we need more context than this (namely, we need to know if we had a
type or not inside the parens, but that is available only at semantic time).
That is why I think that this is WONTFIX bug report.
[1] https://github.com/dlang/dmd/pull/14544
--
More information about the Digitalmars-d-bugs
mailing list