Skip to content

Compilation error when inline def calls typeChecks #7488

@adamgfraser

Description

@adamgfraser

minimized code

import scala.compiletime.testing.typeChecks

object Minimized extends App {
  
  inline final def assertCompiles(inline code: String): Boolean =
    if (typeChecks(code)) true else false
  
  inline val code = "1 + 1"
  val result = assertCompiles(code)
  println(result)
}

// scala.MatchError: EmptyTree (of class dotty.tools.dotc.ast.Trees$EmptyTree)

expectation

I would expect this to compile and return the same result as typeChecks.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions