OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import 'dart:collection'; | 5 import 'dart:collection'; |
6 import 'package:expect/expect.dart'; | 6 import 'package:expect/expect.dart'; |
7 | 7 |
8 abstract class A { | 8 abstract class A {} |
9 } | |
10 | 9 |
11 abstract class B extends Object with IterableMixin<int> { | 10 abstract class B extends Object with IterableMixin<int> { |
12 Iterator<int> get iterator; | 11 Iterator<int> get iterator; |
13 } | 12 } |
14 | 13 |
15 abstract class C extends A with IterableMixin<int> implements B { | 14 abstract class C extends A with IterableMixin<int> implements B { |
16 final list = [1,2,3,4,5]; | 15 final list = [1, 2, 3, 4, 5]; |
17 Iterator<int> get iterator => list.iterator; | 16 Iterator<int> get iterator => list.iterator; |
18 } | 17 } |
19 | 18 |
20 class D extends C { | 19 class D extends C {} |
21 } | |
22 | 20 |
23 void main() { | 21 void main() { |
24 var d = new D(); | 22 var d = new D(); |
25 var expected = 1; | 23 var expected = 1; |
26 for(var i in d) { | 24 for (var i in d) { |
27 Expect.equals(expected, i); | 25 Expect.equals(expected, i); |
28 expected += 1; | 26 expected += 1; |
29 } | 27 } |
30 } | 28 } |
31 | |
OLD | NEW |