Attempt
The second half of attempt, split off only so the caller names E and A is inferred.
The failure is judged by a TypeTest rather than a ClassTag because a union such as SQLException | TimeoutException has no single class: its ClassTag is the common superclass, Exception, and would quietly own every defect the caller never named.
The type stays public, so a caller can hold one and call apply, but the constructor does not: a public one would let new Attempt[Throwable] or new Attempt[Nothing] build the same unguarded savepoint that attempt's summonFrom refuses to hand out. publicInBinary is there only because attempt is inline and expands new Attempt[E] at the call site: Scala refuses to inline a private constructor without it, so attempt itself would not compile.
Attributes
- Source
- Scopes.scala
- Graph
-
- Supertypes