Skip to content

Commit 207b188

Browse files
authored
Merge pull request #2 from bjornregnell/bjornregnell-patch-1
Update docs canthrow.md remove bad type alias at line 70
2 parents ee9d929 + c270354 commit 207b188

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

docs/_docs/reference/experimental/canthrow.md

-3
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,6 @@ How can the capability be produced? There are several possibilities:
6868

6969
Most often, the capability is produced by having a using clause `(using CanThrow[Exc])` in some enclosing scope. This roughly corresponds to a [`throws`](https://docs.oracle.com/javase/specs/jls/se7/html/jls-8.html#jls-8.4.6) clause in Java. The analogy is even stronger since alongside [`CanThrow`](https://scala-lang.org/api/3.x/scala/CanThrow.html) there is also the following type alias defined in the [`scala`](https://scala-lang.org/api/3.x/scala.html) package:
7070
```scala
71-
infix type A = Int
72-
```
73-
```scala
7471
infix type $throws[R, +E <: Exception] = CanThrow[E] ?=> R
7572
```
7673
That is, [`R $throws E`](https://scala-lang.org/api/3.x/scala/runtime.html#$throws-0) is a context function type that takes an implicit `CanThrow[E]` parameter and that returns a value of type `R`. What's more, the compiler will translate an infix types with `throws` as the operator to `$throws` applications according to the rules

0 commit comments

Comments
 (0)