Skip to content

Try statement: Non-normative text in spec does not match the actual VM behaviour #1382

Closed
@DartBot

Description

@DartBot

This issue was originally filed by [email protected]


Not sure whether this is a bug or the spec is incorrect

The very end of ch. 11.9:
If an exception is raised during execution of a catch clause, this will transfer control to the handler for the fi nally clause, causing the fi nally clause to execute in this case as well.

yet the following test fails at the isTrue check:

void main() {
  bool flag = false;
  
  var exStr = "foo", exInt = 2;
  try {
    try {
      throw exStr;
    } catch(String s) {
      throw exInt;
    } catch(int i) {
      Expect.fail("This code shouldn't be executed");
    } catch(var v) {
      Expect.fail("This code shouldn't be executed");
    } finally {
      flag = true;
    }
  } catch (var ok) {
    Expect.equals(exInt, ok);
  }

  Expect.isTrue(flag);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    closed-duplicateClosed in favor of an existing report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions