Skip to content

Method calling typeCheckErrors fails to compile when error is invoked #13871

Closed
@Lasering

Description

@Lasering

Compiler version

3.1.0

Minimized code

import scala.compiletime.{error, codeOf}
import scala.compiletime.testing.*

inline def testError(inline typeName: Any): String = error("Got error " + codeOf(typeName))

transparent inline def compileErrors(inline code: String): List[Error] = typeCheckErrors(code)

typeCheckErrors("""testError("string")""")
compileErrors("""testError("string")""")

Scastie Link

Output

-- Error:
9 |compileErrors("""testError("string")""")
  |^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |Got error "string"

Expectation

Code should compile.

Related to scalameta/munit#453

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions