final class A { int i; void f() { ++i; } final void g() { ++i; } void foo() { f(); g(); } } A snippet from obj2asm on the above, compiled with "dmd -c -O -inline -release": _D4asdf1A3fooMFZv comdat assume CS:_D4asdf1A3fooMFZv push EBX mov EBX,EAX mov ECX,[EBX] call dword ptr 014h[ECX] inc dword ptr 8[EBX] pop EBX ret The call to g is inlined, but the call to f is not. Since class A is final, all methods within it should be considered final for purposes of optimization; thus, in this case, both f and g should be inlined.
This only happens on D1.
(In reply to comment #1) > This only happens on D1. > So? Does this mean that the bug is not considered harmful and thus wont be fixed in D1?
Yes, I would very much like to see this fixed in D1, especially since it's not a spec change at all.
This is listed in the changelog for 1.037, can anyone confirm that it's fixed?
Fixed in DMD 1.037. (At least the simple example in the report.)
*** Issue 1909 has been marked as a duplicate of this issue. ***
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル