Bug 21445 – Indexing a tuple in a static array type suffix fails to compile

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2020-12-02T13:21:05Z
Last change time
2024-12-13T19:13:07Z
Keywords
CTFE, rejects-valid
Assigned to
No Owner
Creator
Max Samukha
Moved to GitHub: dmd#19831 →

Comments

Comment #0 by maxsamukha — 2020-12-02T13:21:05Z
import std.typecons; enum s = tuple(new int[1]); int[s[0].length] a; void main() { } onlineapp.d(4): Error: Tuple([0]) must be an array or pointer type, not Tuple!(int[]) Workaround: enum t = s[0]; int[t.length] a;
Comment #1 by maxsamukha — 2020-12-02T15:10:42Z
Independent test: template alias_(a...) { alias alias_ = a; } struct S { int[] a; alias fields = alias_!(S.tupleof); alias fields this; } enum s = S(new int[1]); int[s[0].length] a; void main() { }
Comment #2 by robert.schadek — 2024-12-13T19:13:07Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19831 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB