haxe-checkstyle icon indicating copy to clipboard operation
haxe-checkstyle copied to clipboard

Add a RedundantParenthesesCheck

Open Gama11 opened this issue 8 years ago • 1 comments

Some people use cast /return / throw like functions by putting extra parens around them, which is misleading:

return (false);
var a:Array<Int> = cast(b);
throw("Something went wrong");

There might be more expressions than just these three.

Gama11 avatar Feb 28 '16 10:02 Gama11

I guess this should probably be generalized to RedundantParenthesesCheck, which also detects cases like these:

var i = (true) = 0 : 1;
if ((object != null) && (object.someProperty == someValue)) {}

Gama11 avatar Mar 05 '16 12:03 Gama11