The following code works in dmd.1.073 but is broken in dmd.1.074. struct Foo {} struct Bar { void opAssign(Foo f) {} } void test() { Foo f; Bar bar = f; // Broken in dmd 1.074-beta Bar baz; baz = f; // Works as expected. }
(In reply to comment #0) > The following code works in dmd.1.073 but is broken in dmd.1.074. > > struct Foo {} > > struct Bar { > void opAssign(Foo f) {} > } > > void test() { > Foo f; > Bar bar = f; // Broken in dmd 1.074-bet That isn't an assignment - it's an initialization. I wonder why that worked before. > > Bar baz; > baz = f; // Works as expected. > }
It is a bug that this ever worked. Assignment is not initialization. However, I will revert to the original behavior to avoid breaking existing code.
Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/96f497a2056cf7d511f4d9f29233ff256eaed1f5 fix Issue 7817 - opAssign to in declaration broken in dmd 1.074 beta1
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル