Status Update
Comments
uc...@google.com <uc...@google.com> #2
er...@browne.name <er...@browne.name> #3
uc...@google.com <uc...@google.com>
tn...@google.com <tn...@google.com> #4
Given a test file like this:
package test.pkg
import android.widget.TextView
class Test : android.app.Activity {
private suspend fun setUi() {
val x = R.string.hello
}
}
if I remove the "suspend" keyword, I get the following UAST tree:
UFile (package = test.pkg)
UImportStatement (isOnDemand = false)
UClass (name = Test)
UAnnotationMethod (name = setUi)
UBlockExpression
UDeclarationsExpression
ULocalVariable (name = x)
UQualifiedReferenceExpression
UQualifiedReferenceExpression
USimpleNameReferenceExpression (identifier = R)
USimpleNameReferenceExpression (identifier = string)
USimpleNameReferenceExpression (identifier = hello)
UAnnotationMethod (name = Test)
However, if I add the suspend keyword back in, I end up with this:
UFile (package = test.pkg)
UImportStatement (isOnDemand = false)
UClass (name = Test)
UAnnotationMethod (name = Test)
Notice how the body of the method is completely missing. I'll file a bug against UAST for this.
er...@browne.name <er...@browne.name> #6
tn...@google.com <tn...@google.com> #7
tn...@google.com <tn...@google.com> #8
ey...@gmail.com <ey...@gmail.com> #9
I'm still getting a false positive using 4.0 Beta 1 and Kotlin 1.3.70
bg_chat_message_received
is reported as unused by Lint:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/small" />
<solid android:color="#FFFF" />
</shape>
but it is being used in the same module (fragmentSingleton
is from Kodein
bind<ShapeHolder>() with fragmentSingleton {
with(context.requireContext()) {
@Suppress("MaxLineLength")
ShapeHolder(
received = Shapes(
single = shape(R.style.ShapeAppearance_Message_Received, R.drawable.bg_chat_message_received)
)
)
}
}
<style name="ShapeAppearance.Message.Received" parent="ShapeAppearance.MaterialComponents.SmallComponent">
<item name="cornerFamily">rounded</item>
<item name="strokeColor">?colorOnSurfaceFaint</item>
<item name="strokeWidth">1dp</item>
<item name="android:fillColor">?colorSurface</item>
<item name="cornerSize">@dimen/small</item>
</style>
tn...@google.com <tn...@google.com> #10
I'm struggling to create a reproducible scenario of the above. I tried adding dependencies on material design as well as the dependencies in
I already have unit tests for suspend functions so I'm assuming there's something unique about this situation.
tn...@google.com <tn...@google.com> #11
(Actually, maybe file a new bug to track it since it must be a different scenario than the original bug report.)
ey...@gmail.com <ey...@gmail.com> #12
Filed
Added some more code.
Description
AGP - 3.4.1