Fixed
Status Update
Comments
uc...@google.com <uc...@google.com>
tn...@google.com <tn...@google.com> #2
Fix pending in Change-Id: I4a273cc4b0d86d1858b9d7d460d1f3bdec431789
pa...@gmail.com <pa...@gmail.com> #4
Tor, tried 4.2.0-alpha08 and the Java warning is fixed, but the MyDiffUtilCallbackKotlin is still failing the same.
Repro (updated AGP to version later than that claimed as fixed) at
tn...@google.com <tn...@google.com> #5
Thanks for the updated repro project! I don't know how I missed the Kotlin case from that sample project, but it turns out its AST shape is slightly different so I needed to look for several different scenarios. Fix pending in Change-Id: I9d954e71b16c84fc5fb8c6a3944e4c5226996641.
Description
Component: Android Public Tracker > App Development > Android Studio > Build Tools > Lint
Studio Build: irrelevant (4.0.1)
Version of Gradle Plugin: 3.6.3 or 4.0.1
Version of Gradle: irrelevant (5.6.4 or 6.5, whichever works with AGP version)
Version of Java: irrelevant (openjdk 1.8.0_242-release)
OS: irrelevant (Windows 10)
Steps to Reproduce:
gradlew lint
in that folderExpected: no lint violations Actual: 2 errors (1 in Java and 1 in Kotlin)
Despite having a workaround in https://issuetracker.google.com/issues/122928037 ,
we think that DiffUtilEquals should not trigger in these cases:
iff Model class has a defined equals method.
This should be especially true in Kotlin where smart casts exist.