Skip to content

Constant string values are not rendered correctly when used for annotation messages #3611

@JKRhb

Description

@JKRhb

As I encountered problems with adjacent strings as input for annotation messages as described in #2393, I tried using a string constant as input instead, like so:

const pleaseRenderMe = 'I am not rendered :(';

@Deprecated(pleaseRenderMe)
void foo() {
  print('bar');
}

However, using this approach led to a different kind of problem, namely that not the constant value, but its name is being rendered in the annotation, which does not seem like the intended behavior, especially since you cannot click on the referenced constant to see its value directly from the annotation:

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requesttype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions