struct S { static if(hasIndirections!(typeof(this))) {} } template hasIndirections(T) { enum hasIndirections = hasIndirectionsImpl!(typeof(T.init.tupleof)); } template hasIndirectionsImpl(T...) { static if (!T.length) { enum hasIndirectionsImpl = false; } else { enum hasIndirectionsImpl = true; } } This is wrong because S isn't fully defined yet, so S.init.tupleof makes no sense. However, the error message is extremely obtuse: Error: struct S no size yet for forward reference
The new diagnostic is: ----- test.d(2): Error: forward reference of variable hasIndirections test.d(2): Error: template instance test.hasIndirections!(S) error instantiating ----- But I'm not sure this is better.
FWIW, the code compiled before https://github.com/dlang/dmd/pull/595.
compiles since 2.080 but AFAIU this should not
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18412 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル