Skip to content

compiletime.error with s-interpolator crashes at runtime #8362

Closed
@travisbrown

Description

@travisbrown

Minimized code

object Test {
  inline def foo: String = scala.compiletime.error(s"")

  def main(args: Array[String]): Unit = println(foo)  
}

Output

Compiles but throws an exception at runtime:

Exception in thread "main" scala.NotImplementedError: an implementation is missing
        at scala.Predef$.$qmark$qmark$qmark(Predef.scala:347)
        at Test$.main(Test.scala:4)
        at Test.main(Test.scala)

Expectation

In the original code println(foo) shouldn't compile (and doesn't if you remove the s from the definition of foo). If using s in the error string isn't allowed, I'd expect the compiler to tell me that instead of throwing an exception at runtime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issuePerfect for someone who wants to get started contributingitype:bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions