[Issue 15984] [REG2.071] Interface contracts retrieve garbage instead of parameters
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Nov 28 07:42:09 UTC 2017
https://issues.dlang.org/show_bug.cgi?id=15984
--- Comment #16 from MichaelZ <dlang.org at bregalad.de> ---
(In reply to robin.kupper from comment #15)
> While the first example works now, parameters in out contracts on interface
> functions are still garbage.
>
> See example https://run.dlang.io/is/c5XDwJ.
Thaynes Example is a little shorter and also still fails, including incorrect
values in the "in" contract.
> Placing the contract on the implementing function currently seems to be the
> only workaround.
Is this really an issue that purely occurs with interfaces? I was under the
impression that inheritance can trigger this as well, but I may be mistaken.
If you're right, then can we - pending a "real" solution - have the compiler
just ignore interface contracts (and emit a warning), rather than generating
bad code?
--
More information about the Digitalmars-d-bugs
mailing list