Forbid needless pointer casts

FlameInHeart validemail at not.really
Thu Feb 20 11:31:17 UTC 2020


Hey,

How about forbidding this:

void foo(Monkey* m) {
     Monkey* m2 = cast(Monkey*) m;
}

Pointer casts are potentially nasty when refactoring and the 
needless ones are easy for the compiler to detect, and probably 
no-one will find objections to this change.

Just an easy win, isn't it?

(not going to write a DIP for this...)


More information about the Digitalmars-d mailing list