Editions Ideas

Walter Bright newshound2 at digitalmars.com
Thu Dec 18 05:33:38 UTC 2025


On 12/15/2025 2:25 AM, Dukc wrote:
> I also sometimes think dip1000 needs to be more *manual*, not more automatic. I 
> see it can sure be confusing when the compiler says something is `scope` that 
> you didn't designate as such. This happens to a local variable that's declared 
> earlier if you assign it to something that needs the storage class.

When an error message is confusing, by far the most practical method to figure 
it out is to:

1. copy the file to a new file, save the original

2. delete code until the message goes away

3. revert to the previous version that still produced the error

4. goto step 2, and delete something else

5. continue until you have the minimum piece of code the generates the error

This usually clears up the understanding of the issue.

The D "dustmite" program can do this automatically.

https://github.com/CyberShadow/DustMite

Recently, I was handed a program with a baffling dip1000 error in it. I noticed 
it was loaded with templates, conditional compilation, irrelevant functions, and 
complex declarations.

Deleting all that fluff out of it led directly to the problem.

This is the most powerful debugging technique I know of. I use it all the time.


More information about the Digitalmars-d mailing list