haxe-checkstyle
haxe-checkstyle copied to clipboard
Add a RedundantParenthesesCheck
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.
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)) {}