Skip to content

Add TypeName.annotated API #2202

@Egorand

Description

@Egorand

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Adding annotations to TypeNames is a bit clunky:

private val composeUiWidgetType = LambdaTypeName.get(
  receiver = null,
  ComposeUi.Modifier,
  returnType = UNIT,
).copy(
  annotations = listOf(
    AnnotationSpec.builder(ComposeRuntime.Composable).build(),
  ),
)

Describe the solution you'd like
A clear and concise description of what you want to happen.

An API that makes it easier:

private val composeUiWidgetType = LambdaTypeName.get(
  receiver = null,
  ComposeUi.Modifier,
  returnType = UNIT,
).annotatedWith(AnnotationSpec.builder(ComposeRuntime.Composable).build())

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Do nothing.

Additional context
Add any other context or screenshots about the feature request here.

N/A

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions