Skip to content

Commit 0914616

Browse files
committed
untyped macros enable textual abstraction in pattern matching
1 parent 562a487 commit 0914616

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

overviews/macros/untypedmacros.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ The cease-typechecking underscore can be used in exactly three places in Scala p
4949
2) as a vararg parameter type in a macro, 3) as a return type of a macro. Usages outside macros or as parts of complex types won't work.
5050
The former will lead to a compile error, the latter, as in e.g. `List[_]`, will produce existential types as usual.
5151

52+
Note that untyped macros enable extractor macros: [SI-5903](https://issues.scala-lang.org/browse/SI-5903). In 2.10.x, it is possible
53+
to declare `unapply` or `unapplySeq` as macros, but usability of such macros is extremely limited as described in the discussion
54+
of the linked JIRA issue. Untyped macros make the full power of textual abstraction available in pattern matching.
55+
5256
If a macro has one or more untyped parameters, then when typing its expansions, the typechecker will do nothing to its arguments
5357
and will pass them to the macro untyped. Even if some of the parameters do have type annotations, they will currently be ignored. This
5458
is something we plan on improving: [SI-6971](https://issues.scala-lang.org/browse/SI-6971). Since arguments aren't typechecked, you

0 commit comments

Comments
 (0)