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

Scala 2 macro definitions should not need @experimental #13793

Closed
bishabosha opened this issue Oct 22, 2021 · 1 comment · Fixed by #13795
Closed

Scala 2 macro definitions should not need @experimental #13793

bishabosha opened this issue Oct 22, 2021 · 1 comment · Fixed by #13795

Comments

@bishabosha
Copy link
Member

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

@bishabosha bishabosha changed the title Scala 2 macro definitions need @experimental Scala 2 macro definitions should not need @experimental Oct 22, 2021
@nicolasstucki nicolasstucki linked a pull request Oct 22, 2021 that will close this issue
@bishabosha
Copy link
Member Author

bishabosha commented Nov 2, 2021

can we propose this for a backport?

Edit - this is the issue not the PR, the PR is nominated already

@bishabosha bishabosha added backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. and removed backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. labels Nov 2, 2021
@Kordyjan Kordyjan added this to the 3.1.2 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants