[Dlang-internal] DIP1000 discussion and testing

Walter Bright via Dlang-internal dlang-internal at puremagic.com
Thu Oct 20 14:36:44 PDT 2016


On 10/20/2016 12:27 PM, Dicebot wrote:
> If I was to judge by available test cases only, I would have decided
> DIP1000 is waste of time and brings nothing useful to the table. They
> are terrible in showing implementation goals being low level regression
> testing artifacts.
>
> Really, do you think anyone will ever be impressed seeing code like
> `int* foo1(return scope int* p) { return p; }`? DIP1000 as defined can
> allow much more interesting things and tests should show that too, not
> just synthetic artifacts.

They are not meant to impress people, nor are they regression tests. They 
illustrate closing of existing safety holes.

   int* bar()
   {
     int p;
     return foo1(&p);
   }

is a currently undetected bug. DIP1000 detects it. DIP1000 also closes safety 
bugs that you posted to Bugzilla (listed in the PR for it).

D must have these fixes, one way or another.

Yes, the test cases are very minimal. But understanding them is necessary in 
order to understand more complex cases - I don't think we've gotten anywhere by 
using complex cases to understand the mechanics of it.




More information about the Dlang-internal mailing list