Skip to content

internal error: Cannot find value parameter(this) #3198

Closed
@peter-ahe-google

Description

@peter-ahe-google

The compiler (dart2js) fails to compile the program below (which I'll add as dart/tests/language/closure_with_super_send_test.dart in a CL later today).

The compiler reports:

tests/language/closure_with_super_send_test.dart:14:3: internal error: Cannot find value parameter(this)
  test() {
  ^^^^
Error: Compilation failed.

class Super {
  m() => "super";
}

class Sub extends Super {
  m() => "sub";

  test() {
    var x;
    [0].forEach((e) => x = super.m());
    return x;
  }
}

main() {
  Expect.equals("super", new Sub().test());
  Expect.equals("super", new Super().m());
  Expect.equals("sub", new Sub().m());
}

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions