Bug 24878 – Forward referencing issue

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2024-11-25T06:11:36Z
Last change time
2024-12-13T19:38:44Z
Assigned to
No Owner
Creator
Manu
Moved to GitHub: dmd#20553 →

Comments

Comment #0 by turkeyman — 2024-11-25T06:11:36Z
struct Container(T) { // T.sizeof/alignof causes circular reference! enum AllocAlignment = T.sizeof; T* ptr; } struct Test { Container!Test test; } error : struct `main.Test` no size because of forward reference error : template instance `main.Container!(Test)` error instantiating Checking T.sizeof causes a forward referencing error; but it doesn't need to evaluate that enum to determine the size of `Container!T` which has a know-able size with no T knowledge... evaluation should be deferred.
Comment #1 by robert.schadek — 2024-12-13T19:38:44Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20553 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB