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/ast/standard_resolution_map.dart'; | 8 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; |
9 import 'package:analyzer/dart/constant/value.dart'; | 9 import 'package:analyzer/dart/constant/value.dart'; |
10 import 'package:analyzer/dart/element/element.dart'; | 10 import 'package:analyzer/dart/element/element.dart'; |
(...skipping 9750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9761 test_instantiateToBounds_functionTypeAlias_simple() { | 9761 test_instantiateToBounds_functionTypeAlias_simple() { |
9762 var library = checkLibrary(''' | 9762 var library = checkLibrary(''' |
9763 typedef F<T extends num>(T p); | 9763 typedef F<T extends num>(T p); |
9764 F f; | 9764 F f; |
9765 '''); | 9765 '''); |
9766 if (isStrongMode) { | 9766 if (isStrongMode) { |
9767 checkElementText( | 9767 checkElementText( |
9768 library, | 9768 library, |
9769 r''' | 9769 r''' |
9770 typedef dynamic F<T extends num>(T p); | 9770 typedef dynamic F<T extends num>(T p); |
9771 F f; | 9771 F<num> f; |
9772 '''); | 9772 '''); |
9773 } else { | 9773 } else { |
9774 checkElementText( | 9774 checkElementText( |
9775 library, | 9775 library, |
9776 r''' | 9776 r''' |
9777 typedef dynamic F<T extends num>(T p); | 9777 typedef dynamic F<T extends num>(T p); |
9778 F f; | 9778 F f; |
9779 '''); | 9779 '''); |
9780 } | 9780 } |
9781 } | 9781 } |
(...skipping 3926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13708 } | 13708 } |
13709 } | 13709 } |
13710 | 13710 |
13711 test_type_reference_to_typedef_with_type_arguments() { | 13711 test_type_reference_to_typedef_with_type_arguments() { |
13712 var library = checkLibrary('typedef U F<T, U>(T t); F<int, String> f;'); | 13712 var library = checkLibrary('typedef U F<T, U>(T t); F<int, String> f;'); |
13713 if (isStrongMode) { | 13713 if (isStrongMode) { |
13714 checkElementText( | 13714 checkElementText( |
13715 library, | 13715 library, |
13716 r''' | 13716 r''' |
13717 typedef U F<T, U>(T t); | 13717 typedef U F<T, U>(T t); |
13718 F f; | 13718 F<int, String> f; |
13719 '''); | 13719 '''); |
13720 } else { | 13720 } else { |
13721 checkElementText( | 13721 checkElementText( |
13722 library, | 13722 library, |
13723 r''' | 13723 r''' |
13724 typedef U F<T, U>(T t); | 13724 typedef U F<T, U>(T t); |
13725 F f; | 13725 F<int, String> f; |
13726 '''); | 13726 '''); |
13727 } | 13727 } |
13728 } | 13728 } |
13729 | 13729 |
13730 test_type_reference_to_typedef_with_type_arguments_implicit() { | 13730 test_type_reference_to_typedef_with_type_arguments_implicit() { |
13731 var library = checkLibrary('typedef U F<T, U>(T t); F f;'); | 13731 var library = checkLibrary('typedef U F<T, U>(T t); F f;'); |
13732 if (isStrongMode) { | 13732 if (isStrongMode) { |
13733 checkElementText( | 13733 checkElementText( |
13734 library, | 13734 library, |
13735 r''' | 13735 r''' |
(...skipping 1245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14981 fail('Unexpectedly tried to get unlinked summary for $uri'); | 14981 fail('Unexpectedly tried to get unlinked summary for $uri'); |
14982 } | 14982 } |
14983 return serializedUnit; | 14983 return serializedUnit; |
14984 } | 14984 } |
14985 | 14985 |
14986 @override | 14986 @override |
14987 bool hasLibrarySummary(String uri) { | 14987 bool hasLibrarySummary(String uri) { |
14988 return true; | 14988 return true; |
14989 } | 14989 } |
14990 } | 14990 } |
OLD | NEW |