You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/reference/metaprogramming/compiletime-ops.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,11 @@
1
1
---
2
2
layout: doc-page
3
-
title: "Compiletime operations"
3
+
title: "Compile-time operations"
4
4
---
5
5
6
6
## The `scala.compiletime` Package
7
7
8
-
The [`scala.compiletime`](https://dotty.epfl.ch/api/scala/compiletime.html) package contains helper definitions that provide support for compiletime operations over values. They are described in the following.
8
+
The [`scala.compiletime`](https://dotty.epfl.ch/api/scala/compiletime.html) package contains helper definitions that provide support for compile-time operations over values. They are described in the following.
9
9
10
10
### `constValue` and `constValueOpt`
11
11
@@ -43,7 +43,7 @@ def erasedValue[T]: T
43
43
```
44
44
45
45
The `erasedValue` function _pretends_ to return a value of its type argument `T`.
46
-
Calling this function will always result in a compiletime error unless the call
46
+
Calling this function will always result in a compile-time error unless the call
47
47
is removed from the code while inlining.
48
48
49
49
Using `erasedValue`, we can then define `defaultValue` as follows:
For more information about compiletime operation, see [PR #4768](https://github.com/lampepfl/dotty/pull/4768),
273
+
For more information about compile-time operations, see [PR #4768](https://github.com/lampepfl/dotty/pull/4768),
274
274
which explains how `summonFrom`'s predecessor (implicit matches) can be used for typelevel programming and code specialization and [PR #7201](https://github.com/lampepfl/dotty/pull/7201) which explains the new `summonFrom` syntax.
0 commit comments