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

Side by Side Diff: tests/language/constructor10_test.dart

Issue 157813005: Check implicit super call in synthetic constructor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add more checking. Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 // Check that the implicit super call for synthetic constructors are checked.
6
7
8 class A {
9 final x;
10 A(this.x);
11 }
12
13 class B extends A {
14 /* /// 00: compile-time error
15 B() : super(null);
16 */ /// 00: continued
17 }
18
19 // ==========
20
21 class X {
22 final x;
23 X(this.x);
24 }
25
26 class Y extends X {
karlklose 2014/02/12 12:51:58 Why not use A instead of X (and F, in the third pa
floitsch 2014/02/12 14:04:52 Done.
27 /* /// 01: compile-time error
28 Y() : super(null);
29 */ /// 01: continued
30 }
31
32 class Z extends Y {
33 Z() : super();
34 }
35
36 // ==============
37
38 class F {
39 final x;
40 F(this.x);
41 }
42
43 class G extends F {
44 /* /// 02: compile-time error
45 G() : super(null);
46 */ /// 02: continued
47 }
48
49 class H extends G {
50 }
51
52 main() {
53 new B().x;
54 new Z().x;
55 new H().x;
56 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698