Skip to content

Commit 71c2e0d

Browse files
committed
Correct example code in the inline.md document
1 parent 5936185 commit 71c2e0d

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

docs/docs/reference/metaprogramming/inline.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,16 @@ inline def power(x: Double, n: Int): Double = {
108108
val y = power(x, n / 2)
109109
if (n % 2 == 0) y * y else y * y * x
110110
}
111-
112-
power(expr, 10)
113-
// translates to
114-
//
115-
// val x = expr
116-
// val y1 = x * x // ^2
117-
// val y2 = y1 * y1 // ^4
118-
// val y3 = y2 * x // ^5
119-
// y3 * y3 // ^10
120111
}
112+
113+
power(expr, 10)
114+
// translates to
115+
//
116+
// val x = expr
117+
// val y1 = x * x // ^2
118+
// val y2 = y1 * y1 // ^4
119+
// val y3 = y2 * x // ^5
120+
// y3 * y3 // ^10
121121
```
122122

123123
Parameters of inline methods can have an `inline` modifier as well. This means

0 commit comments

Comments
 (0)