Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error when inline def calls typeChecks #7488

Closed
adamgfraser opened this issue Nov 3, 2019 · 0 comments
Closed

Compilation error when inline def calls typeChecks #7488

adamgfraser opened this issue Nov 3, 2019 · 0 comments
Assignees

Comments

@adamgfraser
Copy link
Contributor

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.

@nicolasstucki nicolasstucki self-assigned this Nov 3, 2019
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Nov 4, 2019
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Nov 4, 2019
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Nov 4, 2019
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Nov 4, 2019
nicolasstucki added a commit that referenced this issue Nov 4, 2019
Fix #7488 and fix #7487: Get String form ConstantType
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants