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/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
10 import 'package:analyzer/dart/ast/standard_ast_factory.dart'; | 10 import 'package:analyzer/dart/ast/standard_ast_factory.dart'; |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 test_const_invokeConstructor_unnamed_unresolved2() async { | 400 test_const_invokeConstructor_unnamed_unresolved2() async { |
401 await super.test_const_invokeConstructor_unnamed_unresolved2(); | 401 await super.test_const_invokeConstructor_unnamed_unresolved2(); |
402 } | 402 } |
403 | 403 |
404 @failingTest | 404 @failingTest |
405 test_const_invokeConstructor_unnamed_unresolved3() async { | 405 test_const_invokeConstructor_unnamed_unresolved3() async { |
406 await super.test_const_invokeConstructor_unnamed_unresolved3(); | 406 await super.test_const_invokeConstructor_unnamed_unresolved3(); |
407 } | 407 } |
408 | 408 |
409 @failingTest | 409 @failingTest |
410 test_const_length_ofClassConstField_imported() async { | |
411 await super.test_const_length_ofClassConstField_imported(); | |
412 } | |
413 | |
414 @failingTest | |
415 test_const_length_ofClassConstField_imported_withPrefix() async { | 410 test_const_length_ofClassConstField_imported_withPrefix() async { |
416 await super.test_const_length_ofClassConstField_imported_withPrefix(); | 411 await super.test_const_length_ofClassConstField_imported_withPrefix(); |
417 } | 412 } |
418 | 413 |
419 @failingTest | 414 @failingTest |
420 test_const_length_ofTopLevelVariable_imported() async { | 415 test_const_length_ofTopLevelVariable_imported() async { |
421 await super.test_const_length_ofTopLevelVariable_imported(); | 416 await super.test_const_length_ofTopLevelVariable_imported(); |
422 } | 417 } |
423 | 418 |
424 @failingTest | 419 @failingTest |
(...skipping 22 matching lines...) Expand all Loading... |
447 await super | 442 await super |
448 .test_const_parameterDefaultValue_initializingFormal_positional(); | 443 .test_const_parameterDefaultValue_initializingFormal_positional(); |
449 } | 444 } |
450 | 445 |
451 @failingTest | 446 @failingTest |
452 test_const_parameterDefaultValue_normal() async { | 447 test_const_parameterDefaultValue_normal() async { |
453 await super.test_const_parameterDefaultValue_normal(); | 448 await super.test_const_parameterDefaultValue_normal(); |
454 } | 449 } |
455 | 450 |
456 @failingTest | 451 @failingTest |
457 test_const_reference_staticField_imported() async { | |
458 await super.test_const_reference_staticField_imported(); | |
459 } | |
460 | |
461 @failingTest | |
462 test_const_reference_staticField_imported_withPrefix() async { | 452 test_const_reference_staticField_imported_withPrefix() async { |
463 await super.test_const_reference_staticField_imported_withPrefix(); | 453 await super.test_const_reference_staticField_imported_withPrefix(); |
464 } | 454 } |
465 | 455 |
466 @failingTest | 456 @failingTest |
467 test_const_reference_staticMethod() async { | 457 test_const_reference_staticMethod() async { |
468 await super.test_const_reference_staticMethod(); | 458 await super.test_const_reference_staticMethod(); |
469 } | 459 } |
470 | 460 |
471 @failingTest | 461 @failingTest |
(...skipping 15 matching lines...) Expand all Loading... |
487 test_const_reference_topLevelFunction_imported() async { | 477 test_const_reference_topLevelFunction_imported() async { |
488 await super.test_const_reference_topLevelFunction_imported(); | 478 await super.test_const_reference_topLevelFunction_imported(); |
489 } | 479 } |
490 | 480 |
491 @failingTest | 481 @failingTest |
492 test_const_reference_topLevelFunction_imported_withPrefix() async { | 482 test_const_reference_topLevelFunction_imported_withPrefix() async { |
493 await super.test_const_reference_topLevelFunction_imported_withPrefix(); | 483 await super.test_const_reference_topLevelFunction_imported_withPrefix(); |
494 } | 484 } |
495 | 485 |
496 @failingTest | 486 @failingTest |
497 test_const_reference_topLevelVariable_imported() async { | |
498 await super.test_const_reference_topLevelVariable_imported(); | |
499 } | |
500 | |
501 @failingTest | |
502 test_const_reference_topLevelVariable_imported_withPrefix() async { | 487 test_const_reference_topLevelVariable_imported_withPrefix() async { |
503 await super.test_const_reference_topLevelVariable_imported_withPrefix(); | 488 await super.test_const_reference_topLevelVariable_imported_withPrefix(); |
504 } | 489 } |
505 | 490 |
506 @failingTest | 491 @failingTest |
507 test_const_reference_type() async { | 492 test_const_reference_type() async { |
508 await super.test_const_reference_type(); | 493 await super.test_const_reference_type(); |
509 } | 494 } |
510 | 495 |
511 @failingTest | 496 @failingTest |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 test_const_topLevel_super() async { | 537 test_const_topLevel_super() async { |
553 await super.test_const_topLevel_super(); | 538 await super.test_const_topLevel_super(); |
554 } | 539 } |
555 | 540 |
556 @failingTest | 541 @failingTest |
557 test_const_topLevel_this() async { | 542 test_const_topLevel_this() async { |
558 await super.test_const_topLevel_this(); | 543 await super.test_const_topLevel_this(); |
559 } | 544 } |
560 | 545 |
561 @failingTest | 546 @failingTest |
562 test_const_topLevel_typedList_imported() async { | |
563 await super.test_const_topLevel_typedList_imported(); | |
564 } | |
565 | |
566 @failingTest | |
567 test_const_topLevel_typedList_importedWithPrefix() async { | 547 test_const_topLevel_typedList_importedWithPrefix() async { |
568 await super.test_const_topLevel_typedList_importedWithPrefix(); | 548 await super.test_const_topLevel_typedList_importedWithPrefix(); |
569 } | 549 } |
570 | 550 |
571 @failingTest | 551 @failingTest |
572 test_constExpr_pushReference_enum_field() async { | 552 test_constExpr_pushReference_enum_field() async { |
573 await super.test_constExpr_pushReference_enum_field(); | 553 await super.test_constExpr_pushReference_enum_field(); |
574 } | 554 } |
575 | 555 |
576 @failingTest | 556 @failingTest |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
923 test_field_propagatedType_final_dep_inPart() async { | 903 test_field_propagatedType_final_dep_inPart() async { |
924 await super.test_field_propagatedType_final_dep_inPart(); | 904 await super.test_field_propagatedType_final_dep_inPart(); |
925 } | 905 } |
926 | 906 |
927 @failingTest | 907 @failingTest |
928 test_field_propagatedType_final_noDep_instance() async { | 908 test_field_propagatedType_final_noDep_instance() async { |
929 await super.test_field_propagatedType_final_noDep_instance(); | 909 await super.test_field_propagatedType_final_noDep_instance(); |
930 } | 910 } |
931 | 911 |
932 @failingTest | 912 @failingTest |
933 test_function_async() async { | |
934 await super.test_function_async(); | |
935 } | |
936 | |
937 @failingTest | |
938 test_function_asyncStar() async { | |
939 await super.test_function_asyncStar(); | |
940 } | |
941 | |
942 @failingTest | |
943 test_function_documented() async { | 913 test_function_documented() async { |
944 await super.test_function_documented(); | 914 await super.test_function_documented(); |
945 } | 915 } |
946 | 916 |
947 @failingTest | 917 @failingTest |
948 test_function_entry_point_in_export() async { | 918 test_function_entry_point_in_export() async { |
949 await super.test_function_entry_point_in_export(); | 919 await super.test_function_entry_point_in_export(); |
950 } | 920 } |
951 | 921 |
952 @failingTest | 922 @failingTest |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1133 test_import_prefixed() async { | 1103 test_import_prefixed() async { |
1134 await super.test_import_prefixed(); | 1104 await super.test_import_prefixed(); |
1135 } | 1105 } |
1136 | 1106 |
1137 @failingTest | 1107 @failingTest |
1138 test_import_self() async { | 1108 test_import_self() async { |
1139 await super.test_import_self(); | 1109 await super.test_import_self(); |
1140 } | 1110 } |
1141 | 1111 |
1142 @failingTest | 1112 @failingTest |
1143 test_import_short_absolute() async { | |
1144 await super.test_import_short_absolute(); | |
1145 } | |
1146 | |
1147 @failingTest | |
1148 test_import_show() async { | 1113 test_import_show() async { |
1149 await super.test_import_show(); | 1114 await super.test_import_show(); |
1150 } | 1115 } |
1151 | 1116 |
1152 @failingTest | 1117 @failingTest |
1153 test_imports() async { | |
1154 await super.test_imports(); | |
1155 } | |
1156 | |
1157 @failingTest | |
1158 test_inferred_function_type_for_variable_in_generic_function() async { | 1118 test_inferred_function_type_for_variable_in_generic_function() async { |
1159 await super.test_inferred_function_type_for_variable_in_generic_function(); | 1119 await super.test_inferred_function_type_for_variable_in_generic_function(); |
1160 } | 1120 } |
1161 | 1121 |
1162 @failingTest | 1122 @failingTest |
1163 test_inferred_function_type_in_generic_class_in_generic_method() async { | 1123 test_inferred_function_type_in_generic_class_in_generic_method() async { |
1164 await super | 1124 await super |
1165 .test_inferred_function_type_in_generic_class_in_generic_method(); | 1125 .test_inferred_function_type_in_generic_class_in_generic_method(); |
1166 } | 1126 } |
1167 | 1127 |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1385 test_main_typedef_via_export() async { | 1345 test_main_typedef_via_export() async { |
1386 await super.test_main_typedef_via_export(); | 1346 await super.test_main_typedef_via_export(); |
1387 } | 1347 } |
1388 | 1348 |
1389 @failingTest | 1349 @failingTest |
1390 test_main_variable_via_export() async { | 1350 test_main_variable_via_export() async { |
1391 await super.test_main_variable_via_export(); | 1351 await super.test_main_variable_via_export(); |
1392 } | 1352 } |
1393 | 1353 |
1394 @failingTest | 1354 @failingTest |
1395 test_member_function_async() async { | |
1396 await super.test_member_function_async(); | |
1397 } | |
1398 | |
1399 @failingTest | |
1400 test_member_function_asyncStar() async { | |
1401 await super.test_member_function_asyncStar(); | |
1402 } | |
1403 | |
1404 @failingTest | |
1405 test_metadata_classDeclaration() async { | 1355 test_metadata_classDeclaration() async { |
1406 await super.test_metadata_classDeclaration(); | 1356 await super.test_metadata_classDeclaration(); |
1407 } | 1357 } |
1408 | 1358 |
1409 @failingTest | 1359 @failingTest |
1410 test_metadata_classTypeAlias() async { | 1360 test_metadata_classTypeAlias() async { |
1411 await super.test_metadata_classTypeAlias(); | 1361 await super.test_metadata_classTypeAlias(); |
1412 } | 1362 } |
1413 | 1363 |
1414 @failingTest | 1364 @failingTest |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1585 test_method_type_parameter_in_generic_class() async { | 1535 test_method_type_parameter_in_generic_class() async { |
1586 await super.test_method_type_parameter_in_generic_class(); | 1536 await super.test_method_type_parameter_in_generic_class(); |
1587 } | 1537 } |
1588 | 1538 |
1589 @failingTest | 1539 @failingTest |
1590 test_method_type_parameter_with_function_typed_parameter() async { | 1540 test_method_type_parameter_with_function_typed_parameter() async { |
1591 await super.test_method_type_parameter_with_function_typed_parameter(); | 1541 await super.test_method_type_parameter_with_function_typed_parameter(); |
1592 } | 1542 } |
1593 | 1543 |
1594 @failingTest | 1544 @failingTest |
1595 test_nameConflict_exportedAndLocal() async { | |
1596 await super.test_nameConflict_exportedAndLocal(); | |
1597 } | |
1598 | |
1599 @failingTest | |
1600 test_nameConflict_exportedAndLocal_exported() async { | |
1601 await super.test_nameConflict_exportedAndLocal_exported(); | |
1602 } | |
1603 | |
1604 @failingTest | |
1605 test_nameConflict_exportedAndParted() async { | |
1606 await super.test_nameConflict_exportedAndParted(); | |
1607 } | |
1608 | |
1609 @failingTest | |
1610 test_nameConflict_importWithRelativeUri_exportWithAbsolute() async { | |
1611 await super.test_nameConflict_importWithRelativeUri_exportWithAbsolute(); | |
1612 } | |
1613 | |
1614 @failingTest | |
1615 test_nested_generic_functions_in_generic_class_with_function_typed_params() as
ync { | 1545 test_nested_generic_functions_in_generic_class_with_function_typed_params() as
ync { |
1616 await super | 1546 await super |
1617 .test_nested_generic_functions_in_generic_class_with_function_typed_para
ms(); | 1547 .test_nested_generic_functions_in_generic_class_with_function_typed_para
ms(); |
1618 } | 1548 } |
1619 | 1549 |
1620 @failingTest | 1550 @failingTest |
1621 test_nested_generic_functions_in_generic_class_with_local_variables() async { | 1551 test_nested_generic_functions_in_generic_class_with_local_variables() async { |
1622 await super | 1552 await super |
1623 .test_nested_generic_functions_in_generic_class_with_local_variables(); | 1553 .test_nested_generic_functions_in_generic_class_with_local_variables(); |
1624 } | 1554 } |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1822 test_type_reference_to_import_export_in_subdirs() async { | 1752 test_type_reference_to_import_export_in_subdirs() async { |
1823 await super.test_type_reference_to_import_export_in_subdirs(); | 1753 await super.test_type_reference_to_import_export_in_subdirs(); |
1824 } | 1754 } |
1825 | 1755 |
1826 @failingTest | 1756 @failingTest |
1827 test_type_reference_to_import_part() async { | 1757 test_type_reference_to_import_part() async { |
1828 await super.test_type_reference_to_import_part(); | 1758 await super.test_type_reference_to_import_part(); |
1829 } | 1759 } |
1830 | 1760 |
1831 @failingTest | 1761 @failingTest |
1832 test_type_reference_to_import_part2() async { | |
1833 await super.test_type_reference_to_import_part2(); | |
1834 } | |
1835 | |
1836 @failingTest | |
1837 test_type_reference_to_import_part_in_subdir() async { | 1762 test_type_reference_to_import_part_in_subdir() async { |
1838 await super.test_type_reference_to_import_part_in_subdir(); | 1763 await super.test_type_reference_to_import_part_in_subdir(); |
1839 } | 1764 } |
1840 | 1765 |
1841 @failingTest | 1766 @failingTest |
1842 test_type_reference_to_import_relative() async { | 1767 test_type_reference_to_import_relative() async { |
1843 await super.test_type_reference_to_import_relative(); | 1768 await super.test_type_reference_to_import_relative(); |
1844 } | 1769 } |
1845 | 1770 |
1846 @failingTest | 1771 @failingTest |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2067 test_variable_getterInPart_setterInLib() async { | 1992 test_variable_getterInPart_setterInLib() async { |
2068 await super.test_variable_getterInPart_setterInLib(); | 1993 await super.test_variable_getterInPart_setterInLib(); |
2069 } | 1994 } |
2070 | 1995 |
2071 @failingTest | 1996 @failingTest |
2072 test_variable_getterInPart_setterInPart() async { | 1997 test_variable_getterInPart_setterInPart() async { |
2073 await super.test_variable_getterInPart_setterInPart(); | 1998 await super.test_variable_getterInPart_setterInPart(); |
2074 } | 1999 } |
2075 | 2000 |
2076 @failingTest | 2001 @failingTest |
2077 test_variable_propagatedType_final_dep_inLib() async { | |
2078 await super.test_variable_propagatedType_final_dep_inLib(); | |
2079 } | |
2080 | |
2081 @failingTest | |
2082 test_variable_propagatedType_final_dep_inPart() async { | 2002 test_variable_propagatedType_final_dep_inPart() async { |
2083 await super.test_variable_propagatedType_final_dep_inPart(); | 2003 await super.test_variable_propagatedType_final_dep_inPart(); |
2084 } | 2004 } |
2085 | 2005 |
2086 @failingTest | 2006 @failingTest |
2087 test_variable_propagatedType_implicit_dep() async { | |
2088 await super.test_variable_propagatedType_implicit_dep(); | |
2089 } | |
2090 | |
2091 @failingTest | |
2092 test_variable_setterInPart_getterInPart() async { | 2007 test_variable_setterInPart_getterInPart() async { |
2093 await super.test_variable_setterInPart_getterInPart(); | 2008 await super.test_variable_setterInPart_getterInPart(); |
2094 } | 2009 } |
2095 } | 2010 } |
2096 | 2011 |
2097 /** | 2012 /** |
2098 * Builder of [Expression]s from [kernel.Expression]s. | 2013 * Builder of [Expression]s from [kernel.Expression]s. |
2099 */ | 2014 */ |
2100 class _ExprBuilder { | 2015 class _ExprBuilder { |
2101 final _KernelLibraryResynthesizerContextImpl _context; | 2016 final _KernelLibraryResynthesizerContextImpl _context; |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2367 return new _ExprBuilder(this).build(expression); | 2282 return new _ExprBuilder(this).build(expression); |
2368 } | 2283 } |
2369 | 2284 |
2370 @override | 2285 @override |
2371 InterfaceType getInterfaceType( | 2286 InterfaceType getInterfaceType( |
2372 ElementImpl context, kernel.Supertype kernelType) { | 2287 ElementImpl context, kernel.Supertype kernelType) { |
2373 return _getInterfaceType( | 2288 return _getInterfaceType( |
2374 kernelType.className.canonicalName, kernelType.typeArguments); | 2289 kernelType.className.canonicalName, kernelType.typeArguments); |
2375 } | 2290 } |
2376 | 2291 |
| 2292 @override |
| 2293 LibraryElement getLibrary(String uriStr) { |
| 2294 return _resynthesizer.getLibrary(uriStr); |
| 2295 } |
| 2296 |
2377 DartType getType(ElementImpl context, kernel.DartType kernelType) { | 2297 DartType getType(ElementImpl context, kernel.DartType kernelType) { |
2378 if (kernelType is kernel.DynamicType) return DynamicTypeImpl.instance; | 2298 if (kernelType is kernel.DynamicType) return DynamicTypeImpl.instance; |
2379 if (kernelType is kernel.InterfaceType) { | 2299 if (kernelType is kernel.InterfaceType) { |
2380 return _getInterfaceType( | 2300 return _getInterfaceType( |
2381 kernelType.className.canonicalName, kernelType.typeArguments); | 2301 kernelType.className.canonicalName, kernelType.typeArguments); |
2382 } | 2302 } |
2383 if (kernelType is kernel.VoidType) return VoidTypeImpl.instance; | 2303 if (kernelType is kernel.VoidType) return VoidTypeImpl.instance; |
2384 // TODO(scheglov) Support other kernel types. | 2304 // TODO(scheglov) Support other kernel types. |
2385 throw new UnimplementedError('For ${kernelType.runtimeType}'); | 2305 throw new UnimplementedError('For ${kernelType.runtimeType}'); |
2386 } | 2306 } |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2500 } | 2420 } |
2501 | 2421 |
2502 /** | 2422 /** |
2503 * Get the [Source] object for the given [uri]. | 2423 * Get the [Source] object for the given [uri]. |
2504 */ | 2424 */ |
2505 Source _getSource(String uri) { | 2425 Source _getSource(String uri) { |
2506 return _sources.putIfAbsent( | 2426 return _sources.putIfAbsent( |
2507 uri, () => _analysisContext.sourceFactory.forUri(uri)); | 2427 uri, () => _analysisContext.sourceFactory.forUri(uri)); |
2508 } | 2428 } |
2509 } | 2429 } |
OLD | NEW |