File tree 1 file changed +4
-4
lines changed
docs/_docs/reference/metaprogramming 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
107
107
produces an error message containing the given ` msgStr ` .
108
108
109
109
``` scala
110
- import scala .compiletime .{error , code }
110
+ import scala .compiletime .{error , codeOf }
111
111
112
112
inline def fail () =
113
113
error(" failed for a reason" )
@@ -118,10 +118,10 @@ fail() // error: failed for a reason
118
118
or
119
119
120
120
``` 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) )
123
123
124
- fail(identity(" foo" )) // error: failed on: identity("foo")
124
+ fail(identity(" foo" )) // error: failed on: identity[String] ("foo")
125
125
```
126
126
127
127
### The ` scala.compiletime.ops ` package
You can’t perform that action at this time.
0 commit comments