File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
docs/docs/reference/metaprogramming Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -408,13 +408,12 @@ We can already express this using rewrite match expressions and a simple
408408helper function, ` scala.compiletime.erasedValue ` , which is defined as follows:
409409
410410``` scala
411- erased def erasedValue [T ]: T = ???
411+ def erasedValue [T ]: T
412412```
413413
414- The ` erasedValue ` function _ pretends_ to return a value of its type argument
415- ` T ` . In fact, it would always raise a ` NotImplementedError ` exception when
416- called. But the function can in fact never be called, since it is declared
417- ` erased ` , so can only be used at compile-time during type checking.
414+ The ` erasedValue ` function _ pretends_ to return a value of its type argument ` T ` .
415+ Calling this function will always result in a compiletime error unless the call
416+ is removed from the code while inlining.
418417
419418Using ` erasedValue ` , we can then define ` defaultValue ` as follows:
420419
You can’t perform that action at this time.
0 commit comments