Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
None
-
None
-
None
Description
Consider the following:
@groovy.transform.TypeChecked class C { def getFoo(String[] strings) { } void test() { getFoo() foo } } @groovy.transform.TypeChecked void test(Class<?> type) { type.getDeclaredConstructor().newInstance() // getDeclaredConstructor(Class...) type.declaredConstructor.newInstance() }
Since "getFoo" can be called with zero arguments, does that make it a candidate for supporting property syntax? I submit this for consideration.
We have style checks that suggest property syntax when "getName()" is encountered. But this case cannot be converted and so we must live with a warning or add an exclusion.