Closed
Description
With the scala.compiletime.requireConst
in #9764 the inline if
concept becomes redundant.
const
trivially subsume all use-cases of inline if with no extra syntactic overhead
- inline if n == 0 then ...
- else inline if n % 2 == 0 then ...
+ if requireConst(n == 0) then ...
+ else if requireConst(n % 2 == 0) then ...
else
Using const has also the advantage of linking to some documentation in the IDE and is more consistent with the other compile-time operations such as summonInline
.
Advantages
- Less special syntax
- Most inline operations will be found by looking in
scala.compiletime
- Easier to read
else if
s
Disadvantages
- Legacy code