Bug 23652 – Valid code rejected with a "circular reference" error

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2023-01-24T11:46:17Z
Last change time
2024-12-13T19:26:55Z
Keywords
rejects-valid
Assigned to
No Owner
Creator
Max Samukha
See also
https://issues.dlang.org/show_bug.cgi?id=23646
Moved to GitHub: dmd#20219 →

Comments

Comment #0 by maxsamukha — 2023-01-24T11:46:17Z
struct DTB { enum staticOverhead = DispatchTable!().sizeof; } struct DispatchTable() { static assert (DTB.staticOverhead == typeof(this).sizeof); } Error: circular reference to variable `sc.tree.core.DTB.staticOverhead` But the non-templated version compiles successfully: struct DTB { enum staticOverhead = DispatchTable.sizeof; } struct DispatchTable { static assert (DTB.staticOverhead == typeof(this).sizeof); }
Comment #1 by robert.schadek — 2024-12-13T19:26:55Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20219 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB