Spec: execution of an expression handler after return is not documented? #1795
Labels
area-language
Dart language related items (some items might be better tracked at github.com/dart-lang/language).
closed-invalid
Closed as we don't believe the reported issue is generally actionable
This issue was originally filed by ief...@unipro.ru
The spec v 0.07 states the following:
"Executing a return statement return e; first causes evaluation of the expression e, producing an object o. Next, control is transferred to the caller of the current function activation, and the object o is provided to the caller as the result of the function call."
I'm not sure I can see any sentence saying that needed finally clauses must be executed when return transfers control to a caller, e. g.
main() {
try {
return;
} finally{
print("finally!");
}
}
Moreover, I can't see any hints about the following examples:
foo1() {
try {
return 1;
} finally {
return 2;
}
}
foo2() {
try {
throw null;
} finally {
return 2;
}
}
main() {
print(foo1()); //2 should be printed
print(foo2()); //2 should be printed
}
The text was updated successfully, but these errors were encountered: