intellij-community
intellij-community copied to clipboard
False positive SameParameterValueInspection for vararg
I've made a couple of assumptions here (please correct me if I'm wrong).
- It looks like we were avoiding
varargcomparison. I've tried to keep the same behavior here by excludingvarargin positions other than the last parameter from the inspection. - The usage processor doesn't seem to take receiver argument into account (Kotlin extension) and so I've decided omit receiver parameter from being compared against its corresponding argument. There doesn't to be a way to check if a param is a receiver through UAST, so I've opted to check its name.
- I can't seem to find a way to reliably check whether a param is a
varargunless its the last param. I saw this Kotlin PSI while debugging and was wondering whether making a change in the Kotlin plugin would be necessary for this
I've also added a test for the local inspection tool. Let me know if there are any improvements I can make here.