Skip to content

Conversation

nicolasstucki
Copy link
Contributor

Based on #4826

* top-level ~ must contain a call to a static method
  * arguments must be quoted
  * inline arguments can be passed directly
* removed dependency on the original inlined code (removed in PostTyper)
* ReifyQuotes is no longer an InfoTransformer
* Splicer implements both checking and evaluation of splices in a
  single abstraction
* Fix scala#4773
* Fix scala#4735
Now all levels are relative to the definition site.
0 is the level of all non-staged definitions, -1 is the level of
the contents of a top level splice (in an inline method) and positive
levels are (as before) staging levels.
Allow top-level ~ in and non static transparent method:
* Class methods (including inner and anonymous classes)
* Methods in def/val/var
For example a transparent method can be defined as
```
transparent def foo(b: Boolean): Int =
  if (b) ~bar(true)
  else ~bar(false)
```

Removing this restriction also allows us to have a simpler implementation
of splicing and transparent def checking.

Removes last use of `Macro` flag in `ReifyQuotes`.
The Macro flag is now only for Scala 2 macros
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant