My general assumption here is that because you are simply outputting a Text element, there's no node generated for the Greeting function itself. So there is no place to attach any semantics other than the Text node. Consider these two functions:
@Composable
fun Greeting(modifier: Modifier = Modifier, name: String) {
Text(
modifier = modifier.testTag("My Test Tag"),
text = "Hello $name!"
)
}
@Composable
fun Greeting2(modifier: Modifier = Modifier, name: String) {
Greeting(modifier, name)
}
They both output the EXACT SAME semantic tree, regardless of which one you call.
Node #1 at (l=0.0, t=0.0, r=11.0, b=41.0)px
|-Node #2 at (l=0.0, t=0.0, r=11.0, b=41.0)px, Tag: 'My Test Tag'
Text = '[Hello Matt!]'
Actions = [GetTextLayoutResult]