Bug 21795 – Spurious error: static variable `i` cannot be read at compile time as default argument to template alias parameter

Status
NEW
Severity
normal
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-04-04T01:48:21Z
Last change time
2024-12-13T19:15:42Z
Assigned to
No Owner
Creator
Nicholas Wilson
Moved to GitHub: dmd#19903 →

Comments

Comment #0 by iamthewilsonator — 2021-04-04T01:48:21Z
template G(T) { struct G { static int i; } } struct H2(F = float, alias e_ = G!double.i) {} H2!(float) c; // fails with "static variable `i` cannot be read at compile time" H2!(float, G!double.i) c; // passes see also https://issues.dlang.org/show_bug.cgi?id=16472
Comment #1 by robert.schadek — 2024-12-13T19:15:42Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19903 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB