-
Notifications
You must be signed in to change notification settings - Fork 1.1k
can't try catch using a PartialFunction[Throwable, _] #8662
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Comments
decompile:
public void notOk() {
final PartialFunction pf = (PartialFunction)new Main$$anon.Main$$anon$1();
try {
throw new Main.EThrow();
} catch (Throwable ex$) {
pf.apply((Object)ex$);
}
}
public void notOk() {
final PartialFunction pf = (PartialFunction)new Main$$anonfun.Main$$anonfun$1();
try {
throw new Main.EThrow();
} catch (Throwable x$1) {
final PartialFunction catchExpr$1 = pf;
if (catchExpr$1.isDefinedAt((Object)x$1)) {
catchExpr$1.apply((Object)x$1);
return;
}
throw x$1;
}
} |
odersky
added a commit
to dotty-staging/dotty
that referenced
this issue
Apr 4, 2020
giabao
added a commit
to ohze/akka
that referenced
this issue
Apr 5, 2020
Before, dotty only implemented catch handlers that are plain functions. That was an oversight. |
nicolasstucki
added a commit
that referenced
this issue
Apr 6, 2020
Fix #8662: Fix desugaring of try-catches that are partial functions
giabao
added a commit
to ohze/akka
that referenced
this issue
Apr 6, 2020
giabao
added a commit
to ohze/akka
that referenced
this issue
Apr 7, 2020
giabao
added a commit
to ohze/akka
that referenced
this issue
Apr 7, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Minimized code
Runtime output
Expectation
running successfully as in scala 2 (println "OK" 2 times)
The text was updated successfully, but these errors were encountered: