[Issue 17353] is expression type specialization matching strips const
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Feb 19 09:13:42 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=17353
uplink.coder at googlemail.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |uplink.coder at googlemail.com
Resolution|--- |INVALID
--- Comment #1 from uplink.coder at googlemail.com ---
The static if and the static assert are indeed not equivalent
since type-system wise const(int[]) is a constant array of mutable ints.
The pattern-matching is expression set u to the element type of const(int[])
which is const(int).
If you then create the slice type of U you get const(int)[]
which is different from const (int[]).
So there is no discrepancy.
I agree it can be annoying though.
--
More information about the Digitalmars-d-bugs
mailing list