Skip to content

Composed annotations lead to invalid generated code #875

@tlevavasseur-decathlon

Description

@tlevavasseur-decathlon

Ktorfit version

2.5.2

What happened and how can we reproduce this issue?

If I put annotations composed with other annotations like @Deprecated and ReplaceWith

    @GET("some/old/api")
    @Deprecated("this is deprecated")
    suspend fun getSomeOldData( ... ): OldData

the generated code contains an extra @ from ReplaceWith :

        attributes.put(annotationsAttributeKey, listOf(
        Deprecated(message = "this is deprecated", replaceWith = @kotlin.ReplaceWith(expression = ""), level = kotlin.DeprecationLevel.WARNING),
        ))

What did you expect to happen?

the generated code should be

        attributes.put(annotationsAttributeKey, listOf(
        Deprecated(message = "this is deprecated", replaceWith = kotlin.ReplaceWith(expression = ""), level = kotlin.DeprecationLevel.WARNING),
        ))

Is there anything else we need to know about?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions