Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PreferToOverPairSyntax false positive #1066

Closed
vanniktech opened this issue Aug 27, 2018 · 3 comments · Fixed by #1905
Closed

PreferToOverPairSyntax false positive #1066

vanniktech opened this issue Aug 27, 2018 · 3 comments · Fixed by #1905

Comments

@vanniktech
Copy link
Contributor

Android has it's own Pair class. https://developer.android.com/reference/android/util/Pair

That one you can't construct using 1 to 2. Hence the following code should not get flagged:

android.support.v4.util.Pair(Location(0.0, 0.0), 200.0)
@arturbosch
Copy link
Member

arturbosch commented Aug 31, 2018

That's tricky without symbol solving. But we could check the import for that class ^^
And make it configurable for other Pair classes .... but why are you using the android.Pair class at all?

@vanniktech
Copy link
Contributor Author

I wasn't. Probably just a leftover from converting Java to Kotlin class. I don't think the generator changes the Pair class.

@vanniktech
Copy link
Contributor Author

But yeah I agree that the Kotlin one should be used. Maybe there's still an API that requires the Android one to be called. In any case it should not be flagged.

@arturbosch arturbosch modified the milestones: 1.0.2, 1.1.0 Sep 14, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Dec 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants