Skip to content

Commit 0f761a6

Browse files
committed
Apply remaining suggestion to fix doc pages
1 parent d9dcbc9 commit 0f761a6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/_docs/reference/experimental/erased-defs-spec.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ nightlyOf: https://docs.scala-lang.org/scala3/reference/experimental/erased-defs
3939
* `def foo(x: T): U` cannot be overridden by `def foo(erased x: T): U` and vice-versa.
4040

4141
8. Type Restrictions
42-
* Polymorphic functions with erased parameters are currently not supported, and will be rejected by the compiler. This is purely an implementation restriction, and might be lifted in the future.
42+
* Polymorphic function literals with erased parameters are currently not supported, and will be rejected by the compiler. This is purely an implementation restriction, and might be lifted in the future.

docs/_docs/reference/experimental/erased-defs.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ The method works for objects of its type parameter `T`. `T` is required to confo
3838
```scala
3939
def writeList[T]
4040
(out: java.io.ObjectOutputStream, xs: List[T])
41-
(using erased CanSerialize[T]): Unit =
41+
(using CanSerialize[T]): Unit =
4242
safeWriteObject(out, xs)
4343
```
4444
We can test `writeList` by applying it to different types of lists:
@@ -144,7 +144,7 @@ methodWithErasedEv(erasedEvidence, 40) // 42
144144

145145
In some cases we would expect all instances of a trait to be erased. For instance, one could argue that it does not make sense to ever have a `CanSerialize[T]` instance at runtime. In that case we
146146
can make `CanSerialize` extend from a new trait `compiletimetime.Erased` and avoid the explicit
147-
`erased` modifiers in erased parameters and vals. Here is an alternative version our example using this scheme:
147+
`erased` modifiers in erased parameters and vals. Here is an alternative version of our example using this scheme:
148148
```scala
149149
class CanSerialize[T] extends compiletime.Erased
150150
...
@@ -157,7 +157,7 @@ using clause `(using CanSerialize[T])` which gets implicitly tagged with `erased
157157

158158
## Uses of `Erased` in existing Code
159159

160-
- The `CanThrow[T]` typeclass is used to declare that an can be thrown. The compiler generates a `CanThrow[E]` instances for exceptions that are handled in a `try`. Methods take an implicit `CanThrow[E]` parameter to indicate that they might throw exception `E`. `CanThrow` is declared to be an `Erased` capability class, so no actual evidence of `CanThrow` remains at run-time.
160+
- The `CanThrow[T]` type class is used to declare that an exception can be thrown. The compiler generates a `CanThrow[E]` instances for exceptions that are handled in a `try`. Methods take an implicit `CanThrow[E]` parameter to indicate that they might throw exception `E`. `CanThrow` is declared to be an `Erased` capability class, so no actual evidence of `CanThrow` remains at run-time.
161161

162162
- The `CanEqual` evidence of [multiversal equality](../contextual/multiversal-equality.html) checks that two types can be compared. The actual comparison is done by the universal `equals` method of class `Object` or an overriding instance, it does not rely on the `CanEqual` value.
163163
So far, `CanEqual` is handled specially in the compiler. With erased definitions, we could

0 commit comments

Comments
 (0)