File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
docs/_docs/reference/metaprogramming Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ If an inline expansion results in a call `error(msgStr)` the compiler
107107produces an error message containing the given ` msgStr ` .
108108
109109``` scala
110- import scala .compiletime .{error , code }
110+ import scala .compiletime .{error , codeOf }
111111
112112inline def fail () =
113113 error(" failed for a reason" )
@@ -118,10 +118,10 @@ fail() // error: failed for a reason
118118or
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
You can’t perform that action at this time.
0 commit comments