| 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 library engine.non_error_resolver_test; | 5 library engine.non_error_resolver_test; |
| 6 | 6 |
| 7 import 'package:analyzer/src/generated/ast.dart'; | 7 import 'package:analyzer/src/generated/ast.dart'; |
| 8 import 'package:analyzer/src/generated/element.dart'; | 8 import 'package:analyzer/src/generated/element.dart'; |
| 9 import 'package:analyzer/src/generated/error.dart'; | 9 import 'package:analyzer/src/generated/error.dart'; |
| 10 import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode; | 10 import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode; |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 typedef Future<int> F(int i); | 332 typedef Future<int> F(int i); |
| 333 main() { | 333 main() { |
| 334 F f = (int i) async => i; | 334 F f = (int i) async => i; |
| 335 } | 335 } |
| 336 '''); | 336 '''); |
| 337 resolve(source); | 337 resolve(source); |
| 338 assertNoErrors(source); | 338 assertNoErrors(source); |
| 339 verify([source]); | 339 verify([source]); |
| 340 } | 340 } |
| 341 | 341 |
| 342 void test_async_flattened() { |
| 343 Source source = addSource(''' |
| 344 import 'dart:async'; |
| 345 typedef Future<int> CreatesFutureInt(); |
| 346 main() { |
| 347 CreatesFutureInt createFutureInt = () async => f(); |
| 348 Future<int> futureInt = createFutureInt(); |
| 349 futureInt.then((int i) => print(i)); |
| 350 } |
| 351 Future<int> f() => null; |
| 352 '''); |
| 353 resolve(source); |
| 354 assertNoErrors(source); |
| 355 verify([source]); |
| 356 } |
| 357 |
| 342 void test_async_future_dynamic_with_return() { | 358 void test_async_future_dynamic_with_return() { |
| 343 Source source = addSource(''' | 359 Source source = addSource(''' |
| 344 import 'dart:async'; | 360 import 'dart:async'; |
| 345 Future<dynamic> f() async { | 361 Future<dynamic> f() async { |
| 346 return; | 362 return; |
| 347 } | 363 } |
| 348 '''); | 364 '''); |
| 349 resolve(source); | 365 resolve(source); |
| 350 assertNoErrors(source); | 366 assertNoErrors(source); |
| 351 verify([source]); | 367 verify([source]); |
| (...skipping 4988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5340 resolve(source); | 5356 resolve(source); |
| 5341 assertNoErrors(source); | 5357 assertNoErrors(source); |
| 5342 verify([source]); | 5358 verify([source]); |
| 5343 reset(); | 5359 reset(); |
| 5344 } | 5360 } |
| 5345 | 5361 |
| 5346 void _check_wrongNumberOfParametersForOperator1(String name) { | 5362 void _check_wrongNumberOfParametersForOperator1(String name) { |
| 5347 _check_wrongNumberOfParametersForOperator(name, "a"); | 5363 _check_wrongNumberOfParametersForOperator(name, "a"); |
| 5348 } | 5364 } |
| 5349 } | 5365 } |
| OLD | NEW |