Skip to content

Scala 2 macro definitions should not need @experimental #13793

Closed
@bishabosha

Description

@bishabosha

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions