Chromium Code Reviews| 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..e8a15e6f1e5cec38c2a75114543b9d275d632e74 100644 |
| --- a/tests/language/constructor_return_test.dart |
| +++ b/tests/language/constructor_return_test.dart |
| @@ -9,9 +9,17 @@ import "package:expect/expect.dart"; |
| class A { |
| int x; |
| A(this.x) { return; } // 'return;' is equivalent to 'return this;' |
|
kustermann
2013/08/30 11:12:44
If 'return;' is equivalent to 'return this;', what
Søren Gjesse
2013/08/30 13:40:02
The comment is bogus, and I have removed it.
The
|
| + 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); |
| } |