Re: error forward references if scope

2022-03-12 Thread Salih Dincer via Digitalmars-d-learn
On Saturday, 12 March 2022 at 13:12:25 UTC, vit wrote: ```d enum touch_T = __traits(hasMember, T, "touch"); ``` I think you meant build instead of touch? ```d struct Query { public const SharedPtr!Builder builder; } interface Builder { void build(ref Query query); } struct SharedPtr(T)

error forward references if scope

2022-03-12 Thread vit via Digitalmars-d-learn
Hello, why this code compile without problems: ```d struct Query{ public const SharedPtr!Builder builder; } interface Builder{ void build(ref Query query); } struct SharedPtr(T){ enum touch_T = __traits(hasMember, T, "touch"); //... } void main(){ } ``` but if `ref Query