Skip to content

[kotlin] Multi-dollar interpolation parse error in annotations #6648

@stokpop

Description

@stokpop

Kotlin 2.2 multi-dollar string interpolation ($$"...") causes a parse error when used as an annotation argument.

Failing code:

@Scheduled(
    fixedDelayString = $$"${app.interval:PT59M}",
    initialDelayString = $$"${app.interval:PT59M}",
)
fun execute() { }

Error: ParseException / token recognition errors in the ANTLR lexer — the $$ prefix is not recognized.

This is a new occurrence of the gap reported in #6003 (multi-dollar interpolation in general). The specific case here is inside annotation argument lists.

Tested with PMD on main (7.25.0-SNAPSHOT).

Metadata

Metadata

Assignees

No one assigned

    Labels

    a:bugPMD crashes or fails to analyse a file.in:grammarAbout the grammar of a lexer or parser, eg, a parse/lex exception

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions