You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/blog/_posts/2020-02-03-22nd-dotty-milestone-release.md
+30-1Lines changed: 30 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -141,7 +141,33 @@ Translates to:
141
141
a + a + b + b + h() + h()
142
142
```
143
143
144
-
This change was introduced by [PR #8060](https://github.com/lampepfl/dotty/pull/8060/). For more information about the inline capability of Dotty, see [documentation](https://dotty.epfl.ch/docs/reference/metaprogramming/inline.html).
144
+
Notice how the value of the by-name parameter `b` is not inlined but is bound to `def b`. This is an important change that affects all the macros that accepted by-name parameters and analyzed the AST of the underlying code. With this release, such macros will stop working correctly because the AST of the code in question will be the identifier of the by-name parameter, `b` in this case, and not the AST of the code passed under that parameter's name. The workaround is to change all the by-name parameters in your macros to inline parameters.
145
+
146
+
So, if previously you had a macro `inline def operationOnCode(code: => Unit) = ${ mcrImpl('code) }` which did something on the AST of the passed `code`, with this release you need to change it to `inline def operationOnCode(inline code: Unit) = ${ mcrImpl('code) }`.
147
+
148
+
This change was introduced by [PR #8060](https://github.com/lampepfl/dotty/pull/8060/).
149
+
150
+
Another change in the semantics of the inline parameters involves the fact that the can no longer be passed as constants to macro implementations. Previously, the following was possible:
You can obtain the constant value of `n` from within the macro implementation by calling `n.getValue` on it which returns an `Option`. This change was introduced by [PR #8061](https://github.com/lampepfl/dotty/pull/8061).
169
+
170
+
For more information about the inline capability of Dotty, see [documentation](https://dotty.epfl.ch/docs/reference/metaprogramming/inline.html).
145
171
146
172
# Primitive compiletime operations on singleton types
147
173
Contributed by [Maxime Kjaer](https://github.com/MaximeKjaer), this release brings along type-level arithmetic:
@@ -184,6 +210,9 @@ One area where these suggestions will make life easier is purely functional prog
184
210
185
211
For the discussion, see [PR #7862](https://github.com/lampepfl/dotty/pull/7862).
186
212
213
+
# TASTy Inspector library
214
+
TASTy Consumer was renamed to TASTy Inspector as of this release. It was also published in a library of its own. For more information, see the [documentation](https://dotty.epfl.ch/docs/reference/metaprogramming/tasty-inspect.html) on this library.
215
+
187
216
# Let us know what you think!
188
217
189
218
If you have questions or any sort of feedback, feel free to send us a message on our
0 commit comments