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.incremental_resolver_test; | 5 library engine.incremental_resolver_test; |
6 | 6 |
7 import 'package:analyzer/src/context/cache.dart' as task; | 7 import 'package:analyzer/src/context/cache.dart' as task; |
8 import 'package:analyzer/src/generated/ast.dart'; | 8 import 'package:analyzer/src/generated/ast.dart'; |
9 import 'package:analyzer/src/generated/element.dart'; | 9 import 'package:analyzer/src/generated/element.dart'; |
10 import 'package:analyzer/src/generated/engine.dart'; | 10 import 'package:analyzer/src/generated/engine.dart'; |
(...skipping 2328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2339 } | 2339 } |
2340 ''', | 2340 ''', |
2341 r''' | 2341 r''' |
2342 class A { | 2342 class A { |
2343 final field; | 2343 final field; |
2344 A(this.field(int a, String b)); | 2344 A(this.field(int a, String b)); |
2345 } | 2345 } |
2346 '''); | 2346 '''); |
2347 } | 2347 } |
2348 | 2348 |
| 2349 void test_true_functionExpression() { |
| 2350 _assertMatches(r''' |
| 2351 import 'dart:async'; |
| 2352 |
| 2353 class A { |
| 2354 Future<int> mmm() async { |
| 2355 return 42; |
| 2356 } |
| 2357 |
| 2358 a() { |
| 2359 mmm().then((p1) { |
| 2360 return p1.toString(); |
| 2361 }).then((p2) { |
| 2362 print(p2); |
| 2363 }); |
| 2364 } |
| 2365 } |
| 2366 ''', r'''import 'dart:async'; |
| 2367 |
| 2368 class A { |
| 2369 Future<int> mmm() async { |
| 2370 return 42; |
| 2371 } |
| 2372 |
| 2373 a() { |
| 2374 mmm().then((int p1) { |
| 2375 return p1.toString(); |
| 2376 }).then((String p2) { |
| 2377 print(p2); |
| 2378 }); |
| 2379 } |
| 2380 } |
| 2381 '''); |
| 2382 } |
| 2383 |
2349 void test_true_functionTypeAlias_list_reorder() { | 2384 void test_true_functionTypeAlias_list_reorder() { |
2350 _assertMatches( | 2385 _assertMatches( |
2351 r''' | 2386 r''' |
2352 typedef A(int pa); | 2387 typedef A(int pa); |
2353 typedef B(String pb); | 2388 typedef B(String pb); |
2354 typedef C(pc); | 2389 typedef C(pc); |
2355 ''', | 2390 ''', |
2356 r''' | 2391 r''' |
2357 typedef C(pc); | 2392 typedef C(pc); |
2358 typedef A(int pa); | 2393 typedef A(int pa); |
(...skipping 2331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4690 return ResolutionContextBuilder.contextFor(node, listener).scope; | 4725 return ResolutionContextBuilder.contextFor(node, listener).scope; |
4691 } | 4726 } |
4692 } | 4727 } |
4693 | 4728 |
4694 class _Edit { | 4729 class _Edit { |
4695 final int offset; | 4730 final int offset; |
4696 final int length; | 4731 final int length; |
4697 final String replacement; | 4732 final String replacement; |
4698 _Edit(this.offset, this.length, this.replacement); | 4733 _Edit(this.offset, this.length, this.replacement); |
4699 } | 4734 } |
OLD | NEW |