Chromium Code Reviews| Index: test/checker/checker_test.dart |
| diff --git a/test/checker/checker_test.dart b/test/checker/checker_test.dart |
| index abf647235613336ee6b2c718119726dcec8810bf..0a8bbb8c69a7cf77e9e3eb525d16cd0fd519404a 100644 |
| --- a/test/checker/checker_test.dart |
| +++ b/test/checker/checker_test.dart |
| @@ -130,6 +130,36 @@ main() { |
| }); |
| }); |
| + test('Constructors', () { |
| + testChecker({ |
| + '/main.dart': ''' |
| + const num z = 25; |
| + |
| + class A { |
| + int x; |
| + String y; |
| + |
| + A(this.x) : this.y = /*severe:StaticTypeError*/42; |
| + |
| + A.c1(p): this.x = /*info:DownCast*/z, this.y = /*info:DownCast*/p; |
| + |
| + A.c2(this.x, this.y); |
| + } |
|
Leaf
2015/02/26 22:00:16
I think you can say something like:
A.c3(num this
vsm
2015/02/26 23:55:47
Added - along with code to fix. :-)
|
| + |
| + class B extends A { |
| + B() : super(/*severe:StaticTypeError*/"hello"); |
| + |
| + B.c2(int x, String y) : super.c2(/*severe:StaticTypeError*/y, |
| + /*severe:StaticTypeError*/x); |
| + } |
| + |
| + void main() { |
| + var a = new A.c2(z, z); |
| + } |
| + ''' |
| + }); |
| + }); |
| + |
| test('Unbound variable', () { |
| testChecker({ |
| '/main.dart': ''' |