Skip to content

Commit 64815bb

Browse files
authored
Merge pull request #15225 from artemkorsakov/NI-Fix_compiletime-ops_doc
Fixed a typo in the documentation (reference/compiletime-ops.md)
2 parents 965f164 + d1f495f commit 64815bb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/_docs/reference/metaprogramming/compiletime-ops.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ If an inline expansion results in a call `error(msgStr)` the compiler
107107
produces an error message containing the given `msgStr`.
108108

109109
```scala
110-
import scala.compiletime.{error, code}
110+
import scala.compiletime.{error, codeOf}
111111

112112
inline def fail() =
113113
error("failed for a reason")
@@ -118,10 +118,10 @@ fail() // error: failed for a reason
118118
or
119119

120120
```scala
121-
inline def fail(p1: => Any) =
122-
error(code"failed on: $p1")
121+
inline def fail(inline p1: Any) =
122+
error("failed on: " + codeOf(p1))
123123

124-
fail(identity("foo")) // error: failed on: identity("foo")
124+
fail(identity("foo")) // error: failed on: identity[String]("foo")
125125
```
126126

127127
### The `scala.compiletime.ops` package

0 commit comments

Comments
 (0)