Stocki,
Since your report was closed and I didn't fully (the closing) agree with that without research, here's a part of my research:
I found this reply by Danny Thorpe on stackoverflow: http://stackoverflow.com/questions/7759081/is-the-compiler-treatment-of-implicit-interface-variables-documented/19914385#19914385
To quote:
"I recall there have been a few bugs in this area over the years. Long ago (D3? D4?), the compiler didn't reference count the intermediate worked most of the time, but got into trouble in
parameter alias situations. Once that was addressed there was a follow up regarding const params, I believe./*There was always a desire to move disposal of the intermediate value interface up to as soon as possible after the statement in which it was needed, but I don't think that ever got implemented in the Win32 optimizer because the compiler just wasn't set up for handling disposal at statement or block granularity*/."
As you will see, the original intention by the Delphi architects was to release an interface as soon as possible.
The problem was**and is** that their compiler infrastructure doesn't allow that.
So the discussion on the buglist should be read in that context.
Even the designer of Delphi's interface implementation wished they were able to have a better implementation.
CUDO's to the Freepascal compiler guys for more or less achieving that ;)
You have to read it very carefully. It is not about the question, but about the *last part of the answer by Danny.**
*
I hope this sheds some new light on the matter that bothers you so much.
Regards,
Thaddy
