Chromium Code Reviews| Index: tests/language/bad_constructor_test.dart |
| =================================================================== |
| --- tests/language/bad_constructor_test.dart (revision 27958) |
| +++ tests/language/bad_constructor_test.dart (working copy) |
| @@ -5,7 +5,7 @@ |
| class A { |
| // Constructor may not be static. |
| - static A(); /// 00: compile-time error |
| + static A() { } /// 00: compile-time error |
|
Ivan Posva
2013/09/26 20:58:53
Shouldn't
class A {
static A();
}
also be an e
regis
2013/09/26 22:12:26
Yes, it is the same. I just find the syntax with t
|
| // Factory may not be static. |
| static factory A() { return null; } /// 01: compile-time error |
| @@ -14,10 +14,10 @@ |
| var m; |
| A.m() { m = 0; } /// 04: compile-time error |
| - set q(var value) { m = q; } |
| - A.q(); /// 05: compile-time error |
| + set q(var value) { m = q; } // No name conflict with q=. |
| + A.q() { } /// 05: runtime error |
|
Ivan Posva
2013/09/26 20:58:53
In what circumstance do we get a runtime error her
regis
2013/09/26 22:12:26
main calls new A() instead of new A.q().
Comment a
|
| - A.foo() : m = 0; /// 06: compile-time error |
| + A.foo() : m = 0 { } /// 06: compile-time error |
| int foo(int a, int b) => a + b * m; |
| } |