Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Could you look into it @christofferqa?
The issue is with this class:
class MySpi : Spi {
@Volatile
private var myApi: Api? = null
// Incorrectly rewritten to return null;
override fun createApi(): Api {
return myApi ?: synchronized(this) {
myApi ?: MyApi().also { myApi = it }
}
}
}
The error seems to be that the ArgumentPropagator believes that the fieldState of myApi is ExactDynamicType(@NotNull MyApi)
while it should be ExactDynamicType(@Nullable MyApi)
It then removes the first branch (assuming myApi is not null):
return myApi ?: synchronized(this) {
myApi ?: MyApi().also { myApi = it }
}
is rewritten into:
return myApi
And then it eventually concludes that myApi is always null, replacing the code by
return null
The ArgumentPropagatorCodeScanner analyzes the assignment myApi = it
and correctly set join the state to ExactDynamicType(@NotNull MyApi)
However the ArgumentPropagator fails to understand that myApi
can be read before being written in the method, relying on the default null value, so it fails to join null
to the dynamic type.
Description
In FastScroller.drawVerticalScrollbar() , it is calling Canvas.scale() .
canvas.scale(1, 1)
to restore the mirroring for RTL, however it should actually becanvas.scale(-1, 1)
, and the former one is a no-op according toMeanwhile, the touchable width of the scrollbar in RTL should still be its full width, so there's no need to divide it by 2 in FastScroller.isPointInsideVerticalThumb() .