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

Unified Diff: tests/language/constructor_return_test.dart

Issue 23761003: Update language.status and rewrite two tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased Created 7 years, 4 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
« no previous file with comments | « tests/language/constructor_return_negative_test.dart ('k') | tests/language/language_analyzer.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/constructor_return_test.dart
diff --git a/tests/language/constructor_return_test.dart b/tests/language/constructor_return_test.dart
index 8f306458929d7caf9106707279d592868ec8e4f2..f46c9ecc5a7e7dffd73bbf018119ad7987b8718a 100644
--- a/tests/language/constructor_return_test.dart
+++ b/tests/language/constructor_return_test.dart
@@ -8,10 +8,18 @@ import "package:expect/expect.dart";
// statements in the form 'return;'.
class A {
int x;
- A(this.x) { return; } // 'return;' is equivalent to 'return this;'
+ A(this.x) { return; }
+ A.test1(this.x) {
+ return this; /// 01: compile-time error
+ }
+ A.test2(this.x) {
+ return null; /// 02: compile-time error
+ }
int foo(int y) => x + y;
}
main() {
Expect.equals((new A(1)).foo(10), 11);
+ Expect.equals((new A.test1(1)).foo(10), 11);
+ Expect.equals((new A.test2(1)).foo(10), 11);
}
« no previous file with comments | « tests/language/constructor_return_negative_test.dart ('k') | tests/language/language_analyzer.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698