Bug 19794 – const on AliasSeq ignored

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-04-08T23:09:51Z
Last change time
2024-12-13T19:02:55Z
Keywords
accepts-invalid
Assigned to
No Owner
Creator
Yuxuan Shui
Moved to GitHub: dmd#19553 →

Comments

Comment #0 by yshuiv7 — 2019-04-08T23:09:51Z
const(AliasSeq!(int, int)) a; pragma(msg, typeof(a)); // <- (int, int) The compiler should probably at least generate a warning for this case.
Comment #1 by ag0aep6g — 2019-04-08T23:17:37Z
Noteworthy: const AliasSeq!(int, int) b; pragma(msg, typeof(b)); /* (const(int), const(int)) */
Comment #2 by simen.kjaras — 2019-05-05T14:39:29Z
*** Issue 19845 has been marked as a duplicate of this issue. ***
Comment #3 by b2.temp — 2023-12-16T21:06:20Z
Not and ER, that is well a bug, according to https://dlang.org/spec/const3.html#const_type > [...]. Each applies transitively to all subtypes. The problem is that the DMD class `TypeTuple` (in mtype.d) does not override `.constOf`, `immutableOf()`, etc. Tagging as accept-invalid given that ```d alias AliasSeq(T...) = T; const(AliasSeq!(int, int)) a; void main() { a[0] = 1; } ``` should be reject just like when `const` is variable storage class.
Comment #4 by robert.schadek — 2024-12-13T19:02:55Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19553 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB