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
[error] The capability to throw exception ArithmeticException is missing.
[error] The capability can be provided by one of the following:
[error] -A using clause `(using CanThrow[ArithmeticException])`
[error] -A `throws` clause in a result typesuch as `X throws ArithmeticException`
[error] - an enclosing `try` that catches ArithmeticException
[error]
[error] The following importmightfixtheproblem:
[error]
[error] importunsafeExceptions.canThrowAny
[error]
[error] foo()
[error] ^
Expectation
This should compile successfully.
When this gets compiled with -Xprint:typer, one can see that the synthesized CanThrow instance is actually
final lazy given erased val evidence$2: CanThrow[Nothing] = ???
instead of the expected CanThrow[ArithmeticException].
The same problems occurs e.g. for IndexOutOfBoundsException.
The text was updated successfully, but these errors were encountered:
Compiler version
3.1.2-RC1-bin-20211027-435207d-NIGHTLY
Minimized code
Output
Expectation
This should compile successfully.
When this gets compiled with
-Xprint:typer
, one can see that the synthesizedCanThrow
instance is actuallyinstead of the expected
CanThrow[ArithmeticException]
.The same problems occurs e.g. for
IndexOutOfBoundsException
.The text was updated successfully, but these errors were encountered: