Closed
Description
Compiler version
3.1.0
Minimized code
package tastytest
import scala.language.experimental.macros
import scala.reflect.macros.blackbox.Context
object InlineCompat {
def foo(code: String): String = macro InlineCompatScala2Macro.foo
inline def foo(inline code: String): String = code // inline method, not macro
}
object InlineCompatScala2Macro {
def foo(c: Context)(code: c.Tree): c.Tree = code
}
Output
-- Error: /Users/jamie/Workspace/scala/test/tasty/run/src-3/tastytest/InlineCompat.scala:9:6
9 | def foo(code: String): String = macro InlineCompatScala2Macro.foo
| ^
|Experimental erased may only be used with a nightly or snapshot version of the compiler
Expectation
the experimental check for erased should ignore scala 2 macro definitions