Skip to content

co19/LanguageFeatures/Records/on_clauses_A02_t01 #1528

Closed
@scheglov

Description

@scheglov

I think this is not an ambiguity.

main() {
  try {
    print(0);
  } on String {
  } on ([int? i, String? n]) {
//      ^
// [analyzer] unspecified
// [cfe] unspecified
  }
  on();
//^^
// [analyzer] unspecified
// [cfe] unspecified
}

Here, we have one required on clause after try, so we don't have to attempt to parse on ([int? i, String? n]) as on RecordType. And it is not a valid record type, so we parse it as a local function declaration with the name on. And the next on(); invokes it.

Metadata

Metadata

Assignees

Labels

bad-testReport tests in need of updates. When closed, the tests should be considered good

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions