File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,8 @@ inlined at the point of use. Example:
2929The ` Config ` object contains a definition of an ` inline ` value
3030` logging ` . This means that ` logging ` is treated as a constant value,
3131equivalent to its right-hand side ` false ` . The right-hand side of such
32- an inline val must itself be a constant expression. Used in this way,
32+ an inline val must itself be a [ constant
33+ expression] ( #the-definition-of-constant-expression ) . Used in this way,
3334` inline ` is equivalent to Java and Scala 2's ` final ` . ` final ` meaning
3435"constant" is still supported in Dotty, but will be phased out.
3536
@@ -124,11 +125,15 @@ it in backticks, i.e.
124125
125126 @`inline` def ...
126127
128+ ### The definition of constant expression
129+
130+ Right-hand sides of inline values and of arguments for inline parameters
131+ must be constant expressions in the sense defined by the [ SLS §
132+ 6.24] ( https://www.scala-lang.org/files/archive/spec/2.12/06-expressions.html#constant-expressions ) ,
133+ including "platform-specific" extensions such as constant folding of
134+ pure numeric computations.
127135
128136### Reference
129137
130138For more info, see [ PR #1492 ] ( https://github.com/lampepfl/dotty/pull/1492 ) and
131- [ Scala SIP 28] ( http://docs.scala-lang.org/sips/pending/inline-meta.html )
132-
133-
134-
139+ [ Scala SIP 28] ( http://docs.scala-lang.org/sips/pending/inline-meta.html ) .
You can’t perform that action at this time.
0 commit comments