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: compiler/src/dotty/tools/dotc/config/ScalaSettings.scala
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -227,7 +227,7 @@ class ScalaSettings extends Settings.SettingGroup with CommonScalaSettings {
227
227
valYinstrument:Setting[Boolean] =BooleanSetting("-Yinstrument", "Add instrumentation code that counts allocations and closure creations.")
228
228
valYinstrumentDefs:Setting[Boolean] =BooleanSetting("-Yinstrument-defs", "Add instrumentation code that counts method calls; needs -Yinstrument to be set, too.")
valYforceInlineWhileTyping:Setting[Boolean] =BooleanSetting("-Yforce-inline-while-typing", "Make non-transparent inline methods inline when typing. Emulates the old inlining behavior of 3.0.0-M3.")
231
231
232
232
/** Dottydoc specific settings that are not used in scaladoc */
233
233
valdocSnapshot:Setting[Boolean] =BooleanSetting("-doc-snapshot", "Generate a documentation snapshot for the current Dotty version")
Copy file name to clipboardExpand all lines: docs/docs/reference/metaprogramming/inline.md
+7-5Lines changed: 7 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -285,10 +285,11 @@ val one: 1 = zero + 1
285
285
```
286
286
287
287
### Transparent vs. non-transparent inline
288
-
As we already discussed, transparent inline methods will provide a more precise.
289
-
Technically this implies that transparent inline methods must be expanded while typing the program. Other inline methods are inlined later after the program is fully typed.
288
+
As we already discussed, transparent inline methods may influence type checking at call site.
289
+
Technically this implies that transparent inline methods must be expanded during type checking of the program.
290
+
Other inline methods are inlined later after the program is fully typed.
290
291
291
-
For example the following two functions will be typed the same way but will be inlined at different times.
292
+
For example, the following two functions will be typed the same way but will be inlined at different times.
292
293
```scala
293
294
inlinedeff1:T= ...
294
295
transparentinlinedeff2:T= (...):T
@@ -297,7 +298,8 @@ transparent inline def f2: T = (...): T
297
298
A noteworthy difference is the behavior of `transparent inline given`.
298
299
If there is an error reported when inlining that definition, it will be considered as an implicit search mismatch and the search will continue.
299
300
A `transparent inline given` can add a type ascription in its RHS (as in `f2` from the previous example) to avoid the precise type but keep the search behavior.
300
-
On the other hand `inline given` be taken as the implicit and then after typing is done the code is inlined and any error will be emitted as usual.
301
+
On the other hand, `inline given` be taken as the implicit and then inlined after typing.
302
+
Any error will be emitted as usual.
301
303
302
304
## Inline Conditionals
303
305
@@ -328,7 +330,7 @@ below:
328
330
|This location is in code that was inlined at ...
329
331
```
330
332
331
-
In a transparent inline, an `inline if` will force the inlining of any inline definition in its condition.
333
+
In a transparent inline, an `inline if` will force the inlining of any inline definition in its condition during type checking.
0 commit comments