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 library test.src.serialization.elements_test; | 5 library test.src.serialization.elements_test; |
6 | 6 |
7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
8 import 'package:analyzer/dart/constant/value.dart'; | 8 import 'package:analyzer/dart/constant/value.dart'; |
9 import 'package:analyzer/dart/element/element.dart'; | 9 import 'package:analyzer/dart/element/element.dart'; |
10 import 'package:analyzer/dart/element/type.dart'; | 10 import 'package:analyzer/dart/element/type.dart'; |
(...skipping 3629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3640 abstract class D extends C { | 3640 abstract class D extends C { |
3641 var f; | 3641 var f; |
3642 } | 3642 } |
3643 '''); | 3643 '''); |
3644 } | 3644 } |
3645 | 3645 |
3646 test_initializer_executable_with_return_type_from_closure() { | 3646 test_initializer_executable_with_return_type_from_closure() { |
3647 checkLibrary('var v = () => 0;'); | 3647 checkLibrary('var v = () => 0;'); |
3648 } | 3648 } |
3649 | 3649 |
| 3650 test_initializer_executable_with_return_type_from_closure_await_dynamic() { |
| 3651 checkLibrary('var v = (f) async => await f;'); |
| 3652 } |
| 3653 |
| 3654 test_initializer_executable_with_return_type_from_closure_await_future3_int()
{ |
| 3655 checkLibrary(r''' |
| 3656 import 'dart:async'; |
| 3657 var v = (Future<Future<Future<int>>> f) async => await f; |
| 3658 '''); |
| 3659 } |
| 3660 |
| 3661 test_initializer_executable_with_return_type_from_closure_await_future_int() { |
| 3662 checkLibrary(r''' |
| 3663 import 'dart:async'; |
| 3664 var v = (Future<int> f) async => await f; |
| 3665 '''); |
| 3666 } |
| 3667 |
| 3668 test_initializer_executable_with_return_type_from_closure_await_future_noArg()
{ |
| 3669 checkLibrary(r''' |
| 3670 import 'dart:async'; |
| 3671 var v = (Future f) async => await f; |
| 3672 '''); |
| 3673 } |
| 3674 |
3650 test_initializer_executable_with_return_type_from_closure_field() { | 3675 test_initializer_executable_with_return_type_from_closure_field() { |
3651 checkLibrary(''' | 3676 checkLibrary(''' |
3652 class C { | 3677 class C { |
3653 var v = () => 0; | 3678 var v = () => 0; |
3654 } | 3679 } |
3655 '''); | 3680 '''); |
3656 } | 3681 } |
3657 | 3682 |
3658 test_initializer_executable_with_return_type_from_closure_local() { | 3683 test_initializer_executable_with_return_type_from_closure_local() { |
3659 checkLibrary(''' | 3684 checkLibrary(''' |
(...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4777 fail('Unexpectedly tried to get unlinked summary for $uri'); | 4802 fail('Unexpectedly tried to get unlinked summary for $uri'); |
4778 } | 4803 } |
4779 return serializedUnit; | 4804 return serializedUnit; |
4780 } | 4805 } |
4781 | 4806 |
4782 @override | 4807 @override |
4783 bool hasLibrarySummary(String uri) { | 4808 bool hasLibrarySummary(String uri) { |
4784 return true; | 4809 return true; |
4785 } | 4810 } |
4786 } | 4811 } |
OLD | NEW |