[Issue 24025] Expressions contained in parentheses should not be assumed to be C casts

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jul 2 18:35:56 UTC 2023


https://issues.dlang.org/show_bug.cgi?id=24025

--- Comment #1 from Steven Schveighoffer <schveiguy at gmail.com> ---
An alternative to delaying the C style cast to semantic is to just remove the
error.

If a cast from C is desired, then it will work if the type can be constructed
with that parameter.

Back when this error was created, something like `int(5)` was not valid code.
Now it is. So most cases of casting will just have a failed implicit cast
error.

Ironically, this error *hurts* porting C code, instead of helping.

--


More information about the Digitalmars-d-bugs mailing list