| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 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 | 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 | 5 |
| 6 import 'package:expect/expect.dart'; | 6 import 'package:expect/expect.dart'; |
| 7 | 7 |
| 8 import 'dart:async'; | 8 import 'dart:async'; |
| 9 | 9 |
| 10 topLevelFunction() async { } | 10 topLevelFunction() async { } |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 } | 41 } |
| 42 | 42 |
| 43 get value => _x; | 43 get value => _x; |
| 44 } | 44 } |
| 45 | 45 |
| 46 class B { | 46 class B { |
| 47 final _y; | 47 final _y; |
| 48 const B._internal(this._y); | 48 const B._internal(this._y); |
| 49 const factory B.createConst(int y) async = A._internal; /// constructor4: com
pile-time error | 49 const factory B.createConst(int y) async = A._internal; /// constructor4: com
pile-time error |
| 50 | 50 |
| 51 B(); | 51 B() : _y = null; |
| 52 | 52 |
| 53 set dontDoThat(value) async {} /// setter1: compile-time error | 53 set dontDoThat(value) async {} /// setter1: compile-time error |
| 54 } | 54 } |
| 55 | 55 |
| 56 | 56 |
| 57 main() { | 57 main() { |
| 58 var asyncReturn; | 58 var asyncReturn; |
| 59 | 59 |
| 60 asyncReturn = topLevelFunction(); | 60 asyncReturn = topLevelFunction(); |
| 61 Expect.isTrue(asyncReturn is Future); | 61 Expect.isTrue(asyncReturn is Future); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 b2.dontDoThat = 4; /// setter1: compile-time error | 119 b2.dontDoThat = 4; /// setter1: compile-time error |
| 120 | 120 |
| 121 var checkAsync = (var someFunc) { | 121 var checkAsync = (var someFunc) { |
| 122 var toTest = someFunc(); | 122 var toTest = someFunc(); |
| 123 Expect.isTrue(toTest is Future); | 123 Expect.isTrue(toTest is Future); |
| 124 toTest.then((int result) => Expect.equals(result, 4)); | 124 toTest.then((int result) => Expect.equals(result, 4)); |
| 125 }; | 125 }; |
| 126 checkAsync(() async => 4); | 126 checkAsync(() async => 4); |
| 127 | 127 |
| 128 } | 128 } |
| OLD | NEW |