Bug 19392 – [CTFE] static array in a tuple isn't CTFE-able

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-11-12T13:02:20Z
Last change time
2024-12-13T19:01:19Z
Keywords
CTFE, rejects-valid
Assigned to
No Owner
Creator
Илья Ярошенко
Moved to GitHub: dmd#19508 →

Comments

Comment #0 by ilyayaroshenko — 2018-11-12T13:02:20Z
import std.meta; alias A = AliasSeq!(int[1]); struct S { A a; } S foo() { A s; s[0][0] = 1; return S(s); } static assert(foo.a[0][0] == 1); ------------------ onlineapp.d(9): Error: variable __s_field_0 cannot be read at compile time onlineapp.d(13): called from here: foo() onlineapp.d(13): while evaluating: static assert(foo().__a_field_0[0] == 1)
Comment #1 by razvan.nitu1305 — 2023-04-25T14:34:30Z
The code now segfaults.
Comment #2 by robert.schadek — 2024-12-13T19:01:19Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19508 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB