Skip to content

Wrapped typeCheckErrors is emitting compilation errors #12656

Closed
@soronpo

Description

@soronpo

The typeCheckErrors when used inside another definition does not trap the error messages.
Affects munit.

Compiler version

v3.0.0 (also tested on nightly)

Minimized code

  transparent inline def expectCompileError(
      inline code: String,
      expectedMsg: String
  ) =
    val errors = compiletime.testing.typeCheckErrors(code)
    assert(errors.head.message == expectedMsg)

  expectCompileError("""compiletime.error("some error")""", "some error")

Output

error: some error

Expectation

No compilation error (the error should be trapped)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions