Chromium Code Reviews| Index: tests/language/initializing_formal_scope_test.dart |
| diff --git a/tests/language/initializing_formal_capture_test.dart b/tests/language/initializing_formal_scope_test.dart |
| similarity index 77% |
| copy from tests/language/initializing_formal_capture_test.dart |
| copy to tests/language/initializing_formal_scope_test.dart |
| index 7ad3f083cc185754bd31b937bbfba57421445846..3c985c77553f7f88155fe3c0a97e3afe765347ef 100644 |
| --- a/tests/language/initializing_formal_capture_test.dart |
| +++ b/tests/language/initializing_formal_scope_test.dart |
| @@ -7,13 +7,14 @@ |
| import "package:expect/expect.dart"; |
| class A { |
| - var x, y; |
| - A(this.x) : y = (() => x); |
| + var x; |
| + A(this.x) { |
| + // In the body the field is in scope, not the initializing formal. |
| + x += 1; |
| + } |
|
Johnni Winther
2016/06/29 07:22:24
Also add tests for:
A(x, this.x)
A(this.x, x)
eernst
2016/06/29 09:28:31
compiler/dart2js/message_kind_test.dart contains s
|
| } |
| main() { |
| A a = new A(2); |
| - a.x = 3; |
| Expect.equals(a.x, 3); |
| - Expect.equals(a.y(), 2); |
| } |