Original test-case was posted as comment for Issue6296. IMHO, it isn't a duplicate of those issue. DustMite-d testcase: template Rebindable(T) if( is(T) ) { } template hasUnsharedAliasing(R : Rebindable!R) { } struct S { static Z f() { assert(0); } alias typeof(this) Z; } void main() { S.f(); }
One note: the main() is unnecessary for me.
(In reply to comment #1) > One note: the main() is unnecessary for me. For me it isn't unnecessary to call it "main". It can be "g", but it must contain this body.
Sorry, main() is unnecessary if I compile with -g.
Corrected version of my previous comment: For me it isn't necessary to call it "main" (if compiling without -g). It can be "f" or "g", but it must contain "S.f();" in it's body.
$ dmd -c bug6325.d DMD v2.054 DEBUG ty = 36, '_error_' access violation and after removing the templates: $ dmd -c bug6325.d DMD v2.054 DEBUG ty = 38, 'typeof(this)' Error: forward reference of typeof(this) ty = 38, 'typeof(this)' Error: forward reference of typeof(this) Linux x64
Probably the same issue as bug 6774.
This compiles without error on dmd 2.064 head.
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル