Skip to content

Update scala.language.experimental.macro documentation #10335

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

Merged
merged 1 commit into from
Nov 16, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions library/src/scalaShadowing/language.scala
Original file line number Diff line number Diff line change
Expand Up @@ -198,16 +198,20 @@ object language {

import languageFeature.experimental._

/** Where enabled, macro definitions are allowed. Macro implementations and
* macro applications are unaffected; they can be used anywhere.
/** Where enabled, Scala 2 macro definitions are allowed. Scala 2 macro implementations and
* macro applications are unaffected; they can be used anywhere. A Scala 2 macro definition
* must be accompanied by a Scala 3 macro definition with the same signature.
*
* '''Why introduce the feature?''' Macros promise to make the language more regular,
* '''Why introduce the feature?''' Scala 2 macros promise to make the language more regular,
* replacing ad-hoc language constructs with a general powerful abstraction
* capability that can express them. Macros are also a more disciplined and
* powerful replacement for compiler plugins.
*
* '''Why control it?''' For their very power, macros can lead to code that is hard
* to debug and understand.
*
* This is not required by Scala 3 macros as `inline` controls the basic generative macros.
* More add-hoc macros must contain the import of reflection in thier code, making this import redundant.
*/
implicit lazy val macros: macros = languageFeature.experimental.macros

Expand Down