File tree 1 file changed +10
-5
lines changed 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:
29
29
The ` Config ` object contains a definition of an ` inline ` value
30
30
` logging ` . This means that ` logging ` is treated as a constant value,
31
31
equivalent 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,
33
34
` inline ` is equivalent to Java and Scala 2's ` final ` . ` final ` meaning
34
35
"constant" is still supported in Dotty, but will be phased out.
35
36
@@ -124,11 +125,15 @@ it in backticks, i.e.
124
125
125
126
@`inline` def ...
126
127
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.
127
135
128
136
### Reference
129
137
130
138
For 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