Skip to content

@implicitNotFound should emit a compile error when used with non-compile-time constants #10424

@hmemcpy

Description

@hmemcpy

I tried adding an @implicitNotFound annotation on a type, and IntelliJ was helpful enough to offer a multiline default with the .stripMargin trick:

@implicitNotFound(
"""Some
    |multiline
    |text
""".stripMargin)

Unfortunately, even though this code compiled fine, the annotation didn't work, I was not able to see the custom message.

Removing the stripMargin code, and turning it into a string literal solved the issue.

I believe this should be treated as a compile-time error, too easy to make this mistake.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions