You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The const does nothing, it is ignored. It should not compile to write such code.
I’m not suggesting that the following be an error:
alias Base = …; // happens to be constclassC : Base { }
auto obj = newclass Base { };
That might break some code (e.g. if the alias is to a typeof) and the fix might be both annoying and non-trivial. However, if const is lexically in the source file, the fix is to simply remove it. In all likelihood, such code does not exist because, again, the qualifier is ignored.
The text was updated successfully, but these errors were encountered:
Bolpat
pushed a commit
to Bolpat/dmd
that referenced
this issue
Feb 14, 2025
Currently allowed:
The
const
does nothing, it is ignored. It should not compile to write such code.I’m not suggesting that the following be an error:
That might break some code (e.g. if the alias is to a
typeof
) and the fix might be both annoying and non-trivial. However, ifconst
is lexically in the source file, the fix is to simply remove it. In all likelihood, such code does not exist because, again, the qualifier is ignored.The text was updated successfully, but these errors were encountered: