interfaces and contracts - new pattern

Meta jared771 at gmail.com
Tue Dec 3 17:10:04 UTC 2019


On Monday, 2 December 2019 at 20:30:49 UTC, Adam D. Ruppe wrote:
> In short use `in(false)` when you `override` a function to 
> inherit the contract, unless you explicitly want to expand the 
> input - which you shouldn't do when implementing an interface!
>
> Wrote about it in more details here:
>
> http://dpldocs.info/this-week-in-d/Blog.Posted_2019_12_02.html
>
> i think this is a pretty cool little discovery, thanks too for 
> the folks on irc for chatting it through.
>
> destroy if i missed anything lol

I thought this was a defect that was fixed a long time ago, where 
if the overriding function has no contract, it is implicitly 
given a "in (true)" contract, causing the contract of the 
overridden function to not be run. Am I mistaken as to what the 
defect was, or as to whether it was fixed, or both?


More information about the Digitalmars-d-announce mailing list