Skip to content

Commit c1da280

Browse files
authored
Merge pull request #10335 from dotty-staging/update-language-macro-docs
Update scala.language.experimental.macro documentation
2 parents c548048 + 1f55584 commit c1da280

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

library/src/scalaShadowing/language.scala

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,16 +198,20 @@ object language {
198198

199199
import languageFeature.experimental._
200200

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

0 commit comments

Comments
 (0)