File tree 1 file changed +4
-5
lines changed
docs/docs/reference/metaprogramming
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
408
408
helper function, ` scala.compiletime.erasedValue ` , which is defined as follows:
409
409
410
410
``` scala
411
- erased def erasedValue [T ]: T = ???
411
+ def erasedValue [T ]: T
412
412
```
413
413
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.
418
417
419
418
Using ` erasedValue ` , we can then define ` defaultValue ` as follows:
420
419
You can’t perform that action at this time.
0 commit comments