Open WojciechMazur opened 2 years ago
How can I reproduce?
I tried sbt "scalac test.scala"
on main
, scala-cli compile -S 3.2.1-RC1-bin-20220712-7e20b81-NIGHTLY test.scala
and scala-cli compile -S 3.1.1 test.scala
but all compile successfully. Do I need to set additional options?
@mbovel Sorry, I forget to include the second file that actually uses the macro. I've updated the issue reproducer
I managed to bisect it and it looks like the first bad commit is: https://github.com/lampepfl/dotty/commit/0b072d6b7df6d9c65d6ffce779c3417df42b47bd
I checked and it seems that adding makeInlineable
here fixes the issue and doesn't break the compilation for the snippet from https://github.com/lampepfl/dotty/issues/13546. And I don't know why this change was introduced, since the PR only added one test case.
package foo
import scala.quoted.*
private[foo] object Foo:
def apply(): Int = ???
inline def test(): Unit = ${ testExpr() }
private def testExpr()(using Quotes): Expr[Unit] = {
'{ Foo() } match
case '{ Foo() } =>
'{}
}
// usage.scala
def Test() = foo.test()
Community build regression for https://github.com/ciaraobrien/dottytags (maintainer @ciaraobrien) Based on Open Community Build #1858 Part of https://github.com/lampepfl/dotty/issues/15647 regressions tracker
Compiler version
Works with 3.1.0 Fails in 3.1.1 Fails in 3.2.1-RC1-bin-20220712-7e20b81-NIGHTLYon` instead).
Minimized code
Output
Expectation
Compiles with the same output as in 3.1.0: