@@ -33,7 +33,7 @@ object Logger {
3333The ` Config ` object contains a definition of the ** inline value** ` logging ` .
3434This means that ` logging ` is treated as a _ constant value_ , equivalent to its
3535right-hand side ` false ` . The right-hand side of such an ` inline val ` must itself
36- be a [ constant expression] ( https://scala-lang.org/files/archive/spec/2.12/06-expressions.html#constant-expressions ) .
36+ be a [ constant expression] ( https://scala-lang.org/files/archive/spec/2.12/06-expressions.html#constant-expressions ) .
3737Used in this way, ` inline ` is equivalent to Java and Scala 2's ` final ` . Note that ` final ` , meaning
3838_ inlined constant_ , is still supported in Dotty, but will be phased out.
3939
@@ -322,7 +322,7 @@ the singleton type `2`.
322322So far we have seen inline methods that take terms (tuples and integers) as
323323parameters. What if we want to base case distinctions on types instead? For
324324instance, one would like to be able to write a function ` defaultValue ` , that,
325- given a type ` T ` , returns optionally the default value of ` T ` , if it exists.
325+ given a type ` T ` , returns optionally the default value of ` T ` , if it exists.
326326We can already express this using rewrite match expressions and a simple
327327helper function, ` scala.compiletime.erasedValue ` , which is defined as follows:
328328
@@ -362,9 +362,9 @@ Then:
362362 val dAny : None .type = defaultValue[Any ]
363363```
364364
365- As another example, consider the type-level version of ` toInt ` below:
365+ As another example, consider the type-level version of ` toInt ` below:
366366given a _ type_ representing a Peano number,
367- return the integer _ value_ corresponding to it.
367+ return the integer _ value_ corresponding to it.
368368Consider the definitions of numbers as in the _ Inline
369369Match_ section above. Here is how ` toIntT ` can be defined:
370370
@@ -452,7 +452,7 @@ would use it as follows:
452452``` scala
453453import scala .compiletime .summonFrom
454454
455- inline def setFor [T ]: Set [T ] = summonFrom match {
455+ inline def setFor [T ]: Set [T ] = summonFrom {
456456 case given ord : Ordering [T ] => new TreeSet [T ]
457457 case _ => new HashSet [T ]
458458}
0 commit comments