Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Unified Diff: tests/language/initializing_formal_scope_test.dart

Issue 2059883002: Implementation of modified scoping for initializing formals. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Response to IRL discussion Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}

Powered by Google App Engine
This is Rietveld 408576698