OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 analyzer.test.src.summary.resynthesize_kernel_test; | 5 library analyzer.test.src.summary.resynthesize_kernel_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analyzer/dart/element/type.dart'; | 9 import 'package:analyzer/dart/element/type.dart'; |
10 import 'package:analyzer/file_system/file_system.dart'; | 10 import 'package:analyzer/file_system/file_system.dart'; |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 test_class_implicitField_setterFirst() async { | 279 test_class_implicitField_setterFirst() async { |
280 await super.test_class_implicitField_setterFirst(); | 280 await super.test_class_implicitField_setterFirst(); |
281 } | 281 } |
282 | 282 |
283 @failingTest | 283 @failingTest |
284 test_class_interfaces_unresolved() async { | 284 test_class_interfaces_unresolved() async { |
285 await super.test_class_interfaces_unresolved(); | 285 await super.test_class_interfaces_unresolved(); |
286 } | 286 } |
287 | 287 |
288 @failingTest | 288 @failingTest |
289 test_class_method_abstract() async { | |
290 await super.test_class_method_abstract(); | |
291 } | |
292 | |
293 @failingTest | |
294 test_class_method_external() async { | |
295 await super.test_class_method_external(); | |
296 } | |
297 | |
298 @failingTest | |
299 test_class_method_params() async { | 289 test_class_method_params() async { |
300 await super.test_class_method_params(); | 290 await super.test_class_method_params(); |
301 } | 291 } |
302 | 292 |
303 @failingTest | 293 @failingTest |
304 test_class_method_static() async { | |
305 await super.test_class_method_static(); | |
306 } | |
307 | |
308 @failingTest | |
309 test_class_methods() async { | |
310 await super.test_class_methods(); | |
311 } | |
312 | |
313 @failingTest | |
314 test_class_mixins() async { | 294 test_class_mixins() async { |
315 await super.test_class_mixins(); | 295 await super.test_class_mixins(); |
316 } | 296 } |
317 | 297 |
318 @failingTest | 298 @failingTest |
319 test_class_mixins_unresolved() async { | 299 test_class_mixins_unresolved() async { |
320 await super.test_class_mixins_unresolved(); | 300 await super.test_class_mixins_unresolved(); |
321 } | 301 } |
322 | 302 |
323 @failingTest | 303 @failingTest |
(...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1661 test_library_documented_stars() async { | 1641 test_library_documented_stars() async { |
1662 await super.test_library_documented_stars(); | 1642 await super.test_library_documented_stars(); |
1663 } | 1643 } |
1664 | 1644 |
1665 @failingTest | 1645 @failingTest |
1666 test_localFunctions() async { | 1646 test_localFunctions() async { |
1667 await super.test_localFunctions(); | 1647 await super.test_localFunctions(); |
1668 } | 1648 } |
1669 | 1649 |
1670 @failingTest | 1650 @failingTest |
1671 test_localFunctions_inMethod() async { | |
1672 await super.test_localFunctions_inMethod(); | |
1673 } | |
1674 | |
1675 @failingTest | |
1676 test_localFunctions_inTopLevelGetter() async { | 1651 test_localFunctions_inTopLevelGetter() async { |
1677 await super.test_localFunctions_inTopLevelGetter(); | 1652 await super.test_localFunctions_inTopLevelGetter(); |
1678 } | 1653 } |
1679 | 1654 |
1680 @failingTest | 1655 @failingTest |
1681 test_localLabels_inMethod() async { | |
1682 await super.test_localLabels_inMethod(); | |
1683 } | |
1684 | |
1685 @failingTest | |
1686 test_localLabels_inTopLevelFunction() async { | 1656 test_localLabels_inTopLevelFunction() async { |
1687 await super.test_localLabels_inTopLevelFunction(); | 1657 await super.test_localLabels_inTopLevelFunction(); |
1688 } | 1658 } |
1689 | 1659 |
1690 @failingTest | 1660 @failingTest |
1691 test_main_class_alias() async { | 1661 test_main_class_alias() async { |
1692 await super.test_main_class_alias(); | 1662 await super.test_main_class_alias(); |
1693 } | 1663 } |
1694 | 1664 |
1695 @failingTest | 1665 @failingTest |
(...skipping 20 matching lines...) Expand all Loading... |
1716 test_main_typedef() async { | 1686 test_main_typedef() async { |
1717 await super.test_main_typedef(); | 1687 await super.test_main_typedef(); |
1718 } | 1688 } |
1719 | 1689 |
1720 @failingTest | 1690 @failingTest |
1721 test_main_typedef_via_export() async { | 1691 test_main_typedef_via_export() async { |
1722 await super.test_main_typedef_via_export(); | 1692 await super.test_main_typedef_via_export(); |
1723 } | 1693 } |
1724 | 1694 |
1725 @failingTest | 1695 @failingTest |
1726 test_main_variable() async { | |
1727 await super.test_main_variable(); | |
1728 } | |
1729 | |
1730 @failingTest | |
1731 test_main_variable_via_export() async { | 1696 test_main_variable_via_export() async { |
1732 await super.test_main_variable_via_export(); | 1697 await super.test_main_variable_via_export(); |
1733 } | 1698 } |
1734 | 1699 |
1735 @failingTest | 1700 @failingTest |
1736 test_member_function_async() async { | 1701 test_member_function_async() async { |
1737 await super.test_member_function_async(); | 1702 await super.test_member_function_async(); |
1738 } | 1703 } |
1739 | 1704 |
1740 @failingTest | 1705 @failingTest |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1921 test_method_documented() async { | 1886 test_method_documented() async { |
1922 await super.test_method_documented(); | 1887 await super.test_method_documented(); |
1923 } | 1888 } |
1924 | 1889 |
1925 @failingTest | 1890 @failingTest |
1926 test_method_inferred_type_nonStatic_implicit_param() async { | 1891 test_method_inferred_type_nonStatic_implicit_param() async { |
1927 await super.test_method_inferred_type_nonStatic_implicit_param(); | 1892 await super.test_method_inferred_type_nonStatic_implicit_param(); |
1928 } | 1893 } |
1929 | 1894 |
1930 @failingTest | 1895 @failingTest |
1931 test_method_inferred_type_nonStatic_implicit_return() async { | |
1932 await super.test_method_inferred_type_nonStatic_implicit_return(); | |
1933 } | |
1934 | |
1935 @failingTest | |
1936 test_method_type_parameter() async { | 1896 test_method_type_parameter() async { |
1937 await super.test_method_type_parameter(); | 1897 await super.test_method_type_parameter(); |
1938 } | 1898 } |
1939 | 1899 |
1940 @failingTest | 1900 @failingTest |
1941 test_method_type_parameter_in_generic_class() async { | 1901 test_method_type_parameter_in_generic_class() async { |
1942 await super.test_method_type_parameter_in_generic_class(); | 1902 await super.test_method_type_parameter_in_generic_class(); |
1943 } | 1903 } |
1944 | 1904 |
1945 @failingTest | 1905 @failingTest |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2153 test_syntheticFunctionType_noArguments() async { | 2113 test_syntheticFunctionType_noArguments() async { |
2154 await super.test_syntheticFunctionType_noArguments(); | 2114 await super.test_syntheticFunctionType_noArguments(); |
2155 } | 2115 } |
2156 | 2116 |
2157 @failingTest | 2117 @failingTest |
2158 test_syntheticFunctionType_withArguments() async { | 2118 test_syntheticFunctionType_withArguments() async { |
2159 await super.test_syntheticFunctionType_withArguments(); | 2119 await super.test_syntheticFunctionType_withArguments(); |
2160 } | 2120 } |
2161 | 2121 |
2162 @failingTest | 2122 @failingTest |
2163 test_type_arguments_explicit_dynamic_dynamic() async { | |
2164 await super.test_type_arguments_explicit_dynamic_dynamic(); | |
2165 } | |
2166 | |
2167 @failingTest | |
2168 test_type_arguments_explicit_dynamic_int() async { | |
2169 await super.test_type_arguments_explicit_dynamic_int(); | |
2170 } | |
2171 | |
2172 @failingTest | |
2173 test_type_arguments_explicit_String_dynamic() async { | |
2174 await super.test_type_arguments_explicit_String_dynamic(); | |
2175 } | |
2176 | |
2177 @failingTest | |
2178 test_type_arguments_implicit() async { | |
2179 await super.test_type_arguments_implicit(); | |
2180 } | |
2181 | |
2182 @failingTest | |
2183 test_type_dynamic() async { | |
2184 await super.test_type_dynamic(); | |
2185 } | |
2186 | |
2187 @failingTest | |
2188 test_type_invalid_topLevelVariableElement_asType() async { | 2123 test_type_invalid_topLevelVariableElement_asType() async { |
2189 await super.test_type_invalid_topLevelVariableElement_asType(); | 2124 await super.test_type_invalid_topLevelVariableElement_asType(); |
2190 } | 2125 } |
2191 | 2126 |
2192 @failingTest | 2127 @failingTest |
2193 test_type_invalid_topLevelVariableElement_asTypeArgument() async { | 2128 test_type_invalid_topLevelVariableElement_asTypeArgument() async { |
2194 await super.test_type_invalid_topLevelVariableElement_asTypeArgument(); | 2129 await super.test_type_invalid_topLevelVariableElement_asTypeArgument(); |
2195 } | 2130 } |
2196 | 2131 |
2197 @failingTest | 2132 @failingTest |
(...skipping 20 matching lines...) Expand all Loading... |
2218 test_type_reference_part_to_other_part() async { | 2153 test_type_reference_part_to_other_part() async { |
2219 await super.test_type_reference_part_to_other_part(); | 2154 await super.test_type_reference_part_to_other_part(); |
2220 } | 2155 } |
2221 | 2156 |
2222 @failingTest | 2157 @failingTest |
2223 test_type_reference_part_to_part() async { | 2158 test_type_reference_part_to_part() async { |
2224 await super.test_type_reference_part_to_part(); | 2159 await super.test_type_reference_part_to_part(); |
2225 } | 2160 } |
2226 | 2161 |
2227 @failingTest | 2162 @failingTest |
2228 test_type_reference_to_class_with_type_arguments_implicit() async { | |
2229 await super.test_type_reference_to_class_with_type_arguments_implicit(); | |
2230 } | |
2231 | |
2232 @failingTest | |
2233 test_type_reference_to_enum() async { | 2163 test_type_reference_to_enum() async { |
2234 await super.test_type_reference_to_enum(); | 2164 await super.test_type_reference_to_enum(); |
2235 } | 2165 } |
2236 | 2166 |
2237 @failingTest | 2167 @failingTest |
2238 test_type_reference_to_import() async { | 2168 test_type_reference_to_import() async { |
2239 await super.test_type_reference_to_import(); | 2169 await super.test_type_reference_to_import(); |
2240 } | 2170 } |
2241 | 2171 |
2242 @failingTest | 2172 @failingTest |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2513 test_variable_getterInPart_setterInLib() async { | 2443 test_variable_getterInPart_setterInLib() async { |
2514 await super.test_variable_getterInPart_setterInLib(); | 2444 await super.test_variable_getterInPart_setterInLib(); |
2515 } | 2445 } |
2516 | 2446 |
2517 @failingTest | 2447 @failingTest |
2518 test_variable_getterInPart_setterInPart() async { | 2448 test_variable_getterInPart_setterInPart() async { |
2519 await super.test_variable_getterInPart_setterInPart(); | 2449 await super.test_variable_getterInPart_setterInPart(); |
2520 } | 2450 } |
2521 | 2451 |
2522 @failingTest | 2452 @failingTest |
2523 test_variable_implicit_type() async { | |
2524 await super.test_variable_implicit_type(); | |
2525 } | |
2526 | |
2527 @failingTest | |
2528 test_variable_propagatedType_const_noDep() async { | 2453 test_variable_propagatedType_const_noDep() async { |
2529 await super.test_variable_propagatedType_const_noDep(); | 2454 await super.test_variable_propagatedType_const_noDep(); |
2530 } | 2455 } |
2531 | 2456 |
2532 @failingTest | 2457 @failingTest |
2533 test_variable_propagatedType_final_dep_inLib() async { | 2458 test_variable_propagatedType_final_dep_inLib() async { |
2534 await super.test_variable_propagatedType_final_dep_inLib(); | 2459 await super.test_variable_propagatedType_final_dep_inLib(); |
2535 } | 2460 } |
2536 | 2461 |
2537 @failingTest | 2462 @failingTest |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2605 _KernelLibraryResynthesizerContextImpl(this._resynthesizer, this.library); | 2530 _KernelLibraryResynthesizerContextImpl(this._resynthesizer, this.library); |
2606 | 2531 |
2607 @override | 2532 @override |
2608 InterfaceType getInterfaceType( | 2533 InterfaceType getInterfaceType( |
2609 ElementImpl context, kernel.Supertype kernelType) { | 2534 ElementImpl context, kernel.Supertype kernelType) { |
2610 return _getInterfaceType( | 2535 return _getInterfaceType( |
2611 kernelType.className.canonicalName, kernelType.typeArguments); | 2536 kernelType.className.canonicalName, kernelType.typeArguments); |
2612 } | 2537 } |
2613 | 2538 |
2614 DartType getType(ElementImpl context, kernel.DartType kernelType) { | 2539 DartType getType(ElementImpl context, kernel.DartType kernelType) { |
| 2540 if (kernelType is kernel.DynamicType) return DynamicTypeImpl.instance; |
2615 if (kernelType is kernel.InterfaceType) { | 2541 if (kernelType is kernel.InterfaceType) { |
2616 return _getInterfaceType( | 2542 return _getInterfaceType( |
2617 kernelType.className.canonicalName, kernelType.typeArguments); | 2543 kernelType.className.canonicalName, kernelType.typeArguments); |
2618 } | 2544 } |
2619 // TODO(scheglov) Support other kernel types. | 2545 // TODO(scheglov) Support other kernel types. |
2620 throw new UnimplementedError('For ${kernelType.runtimeType}'); | 2546 throw new UnimplementedError('For ${kernelType.runtimeType}'); |
2621 } | 2547 } |
2622 | 2548 |
2623 InterfaceType _getInterfaceType( | 2549 InterfaceType _getInterfaceType( |
2624 kernel.CanonicalName className, List<kernel.DartType> kernelArguments) { | 2550 kernel.CanonicalName className, List<kernel.DartType> kernelArguments) { |
(...skipping 25 matching lines...) Expand all Loading... |
2650 LibraryElementImpl getLibrary(String uriStr) { | 2576 LibraryElementImpl getLibrary(String uriStr) { |
2651 return _libraryMap.putIfAbsent(uriStr, () { | 2577 return _libraryMap.putIfAbsent(uriStr, () { |
2652 var kernel = _kernelMap[uriStr]; | 2578 var kernel = _kernelMap[uriStr]; |
2653 if (kernel == null) return null; | 2579 if (kernel == null) return null; |
2654 var libraryContext = | 2580 var libraryContext = |
2655 new _KernelLibraryResynthesizerContextImpl(this, kernel); | 2581 new _KernelLibraryResynthesizerContextImpl(this, kernel); |
2656 return new LibraryElementImpl.forKernel(_analysisContext, libraryContext); | 2582 return new LibraryElementImpl.forKernel(_analysisContext, libraryContext); |
2657 }); | 2583 }); |
2658 } | 2584 } |
2659 } | 2585 } |
OLD | NEW |