| 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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 test_class_setter_static() async { | 364 test_class_setter_static() async { |
| 365 await super.test_class_setter_static(); | 365 await super.test_class_setter_static(); |
| 366 } | 366 } |
| 367 | 367 |
| 368 @failingTest | 368 @failingTest |
| 369 test_class_setters() async { | 369 test_class_setters() async { |
| 370 await super.test_class_setters(); | 370 await super.test_class_setters(); |
| 371 } | 371 } |
| 372 | 372 |
| 373 @failingTest | 373 @failingTest |
| 374 test_class_supertype_unresolved() async { |
| 375 await super.test_class_supertype_unresolved(); |
| 376 } |
| 377 |
| 378 @failingTest |
| 374 test_class_type_parameters_bound() async { | 379 test_class_type_parameters_bound() async { |
| 375 await super.test_class_type_parameters_bound(); | 380 await super.test_class_type_parameters_bound(); |
| 376 } | 381 } |
| 377 | 382 |
| 378 @failingTest | 383 @failingTest |
| 379 test_class_type_parameters_f_bound_complex() async { | 384 test_class_type_parameters_f_bound_complex() async { |
| 380 await super.test_class_type_parameters_f_bound_complex(); | 385 await super.test_class_type_parameters_f_bound_complex(); |
| 381 } | 386 } |
| 382 | 387 |
| 383 @failingTest | 388 @failingTest |
| (...skipping 1769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2153 test_syntheticFunctionType_inGenericClass() async { | 2158 test_syntheticFunctionType_inGenericClass() async { |
| 2154 await super.test_syntheticFunctionType_inGenericClass(); | 2159 await super.test_syntheticFunctionType_inGenericClass(); |
| 2155 } | 2160 } |
| 2156 | 2161 |
| 2157 @failingTest | 2162 @failingTest |
| 2158 test_syntheticFunctionType_inGenericFunction() async { | 2163 test_syntheticFunctionType_inGenericFunction() async { |
| 2159 await super.test_syntheticFunctionType_inGenericFunction(); | 2164 await super.test_syntheticFunctionType_inGenericFunction(); |
| 2160 } | 2165 } |
| 2161 | 2166 |
| 2162 @failingTest | 2167 @failingTest |
| 2168 test_syntheticFunctionType_noArguments() async { |
| 2169 await super.test_syntheticFunctionType_noArguments(); |
| 2170 } |
| 2171 |
| 2172 @failingTest |
| 2173 test_syntheticFunctionType_withArguments() async { |
| 2174 await super.test_syntheticFunctionType_withArguments(); |
| 2175 } |
| 2176 |
| 2177 @failingTest |
| 2163 test_type_arguments_explicit_dynamic_dynamic() async { | 2178 test_type_arguments_explicit_dynamic_dynamic() async { |
| 2164 await super.test_type_arguments_explicit_dynamic_dynamic(); | 2179 await super.test_type_arguments_explicit_dynamic_dynamic(); |
| 2165 } | 2180 } |
| 2166 | 2181 |
| 2167 @failingTest | 2182 @failingTest |
| 2168 test_type_arguments_explicit_dynamic_int() async { | 2183 test_type_arguments_explicit_dynamic_int() async { |
| 2169 await super.test_type_arguments_explicit_dynamic_int(); | 2184 await super.test_type_arguments_explicit_dynamic_int(); |
| 2170 } | 2185 } |
| 2171 | 2186 |
| 2172 @failingTest | 2187 @failingTest |
| 2173 test_type_arguments_explicit_String_dynamic() async { | 2188 test_type_arguments_explicit_String_dynamic() async { |
| 2174 await super.test_type_arguments_explicit_String_dynamic(); | 2189 await super.test_type_arguments_explicit_String_dynamic(); |
| 2175 } | 2190 } |
| 2176 | 2191 |
| 2177 @failingTest | 2192 @failingTest |
| 2178 test_type_arguments_explicit_String_int() async { | |
| 2179 await super.test_type_arguments_explicit_String_int(); | |
| 2180 } | |
| 2181 | |
| 2182 @failingTest | |
| 2183 test_type_arguments_implicit() async { | 2193 test_type_arguments_implicit() async { |
| 2184 await super.test_type_arguments_implicit(); | 2194 await super.test_type_arguments_implicit(); |
| 2185 } | 2195 } |
| 2186 | 2196 |
| 2187 @failingTest | 2197 @failingTest |
| 2188 test_type_dynamic() async { | 2198 test_type_dynamic() async { |
| 2189 await super.test_type_dynamic(); | 2199 await super.test_type_dynamic(); |
| 2190 } | 2200 } |
| 2191 | 2201 |
| 2192 @failingTest | 2202 @failingTest |
| (...skipping 30 matching lines...) Expand all Loading... |
| 2223 test_type_reference_part_to_other_part() async { | 2233 test_type_reference_part_to_other_part() async { |
| 2224 await super.test_type_reference_part_to_other_part(); | 2234 await super.test_type_reference_part_to_other_part(); |
| 2225 } | 2235 } |
| 2226 | 2236 |
| 2227 @failingTest | 2237 @failingTest |
| 2228 test_type_reference_part_to_part() async { | 2238 test_type_reference_part_to_part() async { |
| 2229 await super.test_type_reference_part_to_part(); | 2239 await super.test_type_reference_part_to_part(); |
| 2230 } | 2240 } |
| 2231 | 2241 |
| 2232 @failingTest | 2242 @failingTest |
| 2233 test_type_reference_to_class() async { | |
| 2234 await super.test_type_reference_to_class(); | |
| 2235 } | |
| 2236 | |
| 2237 @failingTest | |
| 2238 test_type_reference_to_class_with_type_arguments() async { | |
| 2239 await super.test_type_reference_to_class_with_type_arguments(); | |
| 2240 } | |
| 2241 | |
| 2242 @failingTest | |
| 2243 test_type_reference_to_class_with_type_arguments_implicit() async { | 2243 test_type_reference_to_class_with_type_arguments_implicit() async { |
| 2244 await super.test_type_reference_to_class_with_type_arguments_implicit(); | 2244 await super.test_type_reference_to_class_with_type_arguments_implicit(); |
| 2245 } | 2245 } |
| 2246 | 2246 |
| 2247 @failingTest | 2247 @failingTest |
| 2248 test_type_reference_to_enum() async { | 2248 test_type_reference_to_enum() async { |
| 2249 await super.test_type_reference_to_enum(); | 2249 await super.test_type_reference_to_enum(); |
| 2250 } | 2250 } |
| 2251 | 2251 |
| 2252 @failingTest | 2252 @failingTest |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2513 test_variable_const() async { | 2513 test_variable_const() async { |
| 2514 await super.test_variable_const(); | 2514 await super.test_variable_const(); |
| 2515 } | 2515 } |
| 2516 | 2516 |
| 2517 @failingTest | 2517 @failingTest |
| 2518 test_variable_documented() async { | 2518 test_variable_documented() async { |
| 2519 await super.test_variable_documented(); | 2519 await super.test_variable_documented(); |
| 2520 } | 2520 } |
| 2521 | 2521 |
| 2522 @failingTest | 2522 @failingTest |
| 2523 test_variable_final() async { | |
| 2524 await super.test_variable_final(); | |
| 2525 } | |
| 2526 | |
| 2527 @failingTest | |
| 2528 test_variable_final_top_level_untyped() async { | |
| 2529 await super.test_variable_final_top_level_untyped(); | |
| 2530 } | |
| 2531 | |
| 2532 @failingTest | |
| 2533 test_variable_getterInLib_setterInPart() async { | 2523 test_variable_getterInLib_setterInPart() async { |
| 2534 await super.test_variable_getterInLib_setterInPart(); | 2524 await super.test_variable_getterInLib_setterInPart(); |
| 2535 } | 2525 } |
| 2536 | 2526 |
| 2537 @failingTest | 2527 @failingTest |
| 2538 test_variable_getterInPart_setterInLib() async { | 2528 test_variable_getterInPart_setterInLib() async { |
| 2539 await super.test_variable_getterInPart_setterInLib(); | 2529 await super.test_variable_getterInPart_setterInLib(); |
| 2540 } | 2530 } |
| 2541 | 2531 |
| 2542 @failingTest | 2532 @failingTest |
| 2543 test_variable_getterInPart_setterInPart() async { | 2533 test_variable_getterInPart_setterInPart() async { |
| 2544 await super.test_variable_getterInPart_setterInPart(); | 2534 await super.test_variable_getterInPart_setterInPart(); |
| 2545 } | 2535 } |
| 2546 | 2536 |
| 2547 @failingTest | 2537 @failingTest |
| 2548 test_variable_implicit_type() async { | 2538 test_variable_implicit_type() async { |
| 2549 await super.test_variable_implicit_type(); | 2539 await super.test_variable_implicit_type(); |
| 2550 } | 2540 } |
| 2551 | 2541 |
| 2552 @failingTest | 2542 @failingTest |
| 2553 test_variable_inferred_type_implicit_initialized() async { | |
| 2554 await super.test_variable_inferred_type_implicit_initialized(); | |
| 2555 } | |
| 2556 | |
| 2557 @failingTest | |
| 2558 test_variable_propagatedType_const_noDep() async { | 2543 test_variable_propagatedType_const_noDep() async { |
| 2559 await super.test_variable_propagatedType_const_noDep(); | 2544 await super.test_variable_propagatedType_const_noDep(); |
| 2560 } | 2545 } |
| 2561 | 2546 |
| 2562 @failingTest | 2547 @failingTest |
| 2563 test_variable_propagatedType_final_dep_inLib() async { | 2548 test_variable_propagatedType_final_dep_inLib() async { |
| 2564 await super.test_variable_propagatedType_final_dep_inLib(); | 2549 await super.test_variable_propagatedType_final_dep_inLib(); |
| 2565 } | 2550 } |
| 2566 | 2551 |
| 2567 @failingTest | 2552 @failingTest |
| 2568 test_variable_propagatedType_final_dep_inPart() async { | 2553 test_variable_propagatedType_final_dep_inPart() async { |
| 2569 await super.test_variable_propagatedType_final_dep_inPart(); | 2554 await super.test_variable_propagatedType_final_dep_inPart(); |
| 2570 } | 2555 } |
| 2571 | 2556 |
| 2572 @failingTest | 2557 @failingTest |
| 2573 test_variable_propagatedType_final_noDep() async { | |
| 2574 await super.test_variable_propagatedType_final_noDep(); | |
| 2575 } | |
| 2576 | |
| 2577 @failingTest | |
| 2578 test_variable_propagatedType_implicit_dep() async { | 2558 test_variable_propagatedType_implicit_dep() async { |
| 2579 await super.test_variable_propagatedType_implicit_dep(); | 2559 await super.test_variable_propagatedType_implicit_dep(); |
| 2580 } | 2560 } |
| 2581 | 2561 |
| 2582 @failingTest | 2562 @failingTest |
| 2583 test_variable_setterInPart_getterInPart() async { | 2563 test_variable_setterInPart_getterInPart() async { |
| 2584 await super.test_variable_setterInPart_getterInPart(); | 2564 await super.test_variable_setterInPart_getterInPart(); |
| 2585 } | 2565 } |
| 2586 | |
| 2587 @failingTest | |
| 2588 test_variables() async { | |
| 2589 await super.test_variables(); | |
| 2590 } | |
| 2591 } | 2566 } |
| 2592 | 2567 |
| 2593 class _FileSystemAdaptor implements FileSystem { | 2568 class _FileSystemAdaptor implements FileSystem { |
| 2594 final ResourceProvider provider; | 2569 final ResourceProvider provider; |
| 2595 | 2570 |
| 2596 _FileSystemAdaptor(this.provider); | 2571 _FileSystemAdaptor(this.provider); |
| 2597 | 2572 |
| 2598 @override | 2573 @override |
| 2599 FileSystemEntity entityForUri(Uri uri) { | 2574 FileSystemEntity entityForUri(Uri uri) { |
| 2600 if (uri.isScheme('file')) { | 2575 if (uri.isScheme('file')) { |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2650 return _getInterfaceType( | 2625 return _getInterfaceType( |
| 2651 kernelType.className.canonicalName, kernelType.typeArguments); | 2626 kernelType.className.canonicalName, kernelType.typeArguments); |
| 2652 } | 2627 } |
| 2653 | 2628 |
| 2654 DartType getType(ElementImpl context, kernel.DartType kernelType) { | 2629 DartType getType(ElementImpl context, kernel.DartType kernelType) { |
| 2655 if (kernelType is kernel.InterfaceType) { | 2630 if (kernelType is kernel.InterfaceType) { |
| 2656 return _getInterfaceType( | 2631 return _getInterfaceType( |
| 2657 kernelType.className.canonicalName, kernelType.typeArguments); | 2632 kernelType.className.canonicalName, kernelType.typeArguments); |
| 2658 } | 2633 } |
| 2659 // TODO(scheglov) Support other kernel types. | 2634 // TODO(scheglov) Support other kernel types. |
| 2660 return null; | 2635 throw new UnimplementedError('For ${kernelType.runtimeType}'); |
| 2661 } | 2636 } |
| 2662 | 2637 |
| 2663 InterfaceType _getInterfaceType( | 2638 InterfaceType _getInterfaceType( |
| 2664 kernel.CanonicalName className, List<kernel.DartType> kernelArguments) { | 2639 kernel.CanonicalName className, List<kernel.DartType> kernelArguments) { |
| 2665 var libraryName = className.parent; | 2640 var libraryName = className.parent; |
| 2666 var libraryElement = _resynthesizer.getLibrary(libraryName.name); | 2641 var libraryElement = _resynthesizer.getLibrary(libraryName.name); |
| 2667 ClassElementImpl classElement = libraryElement.getType(className.name); | 2642 ClassElementImpl classElement = libraryElement.getType(className.name); |
| 2668 | 2643 |
| 2669 if (kernelArguments.isEmpty) { | 2644 if (kernelArguments.isEmpty) { |
| 2670 return classElement.type; | 2645 return classElement.type; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 2690 LibraryElementImpl getLibrary(String uriStr) { | 2665 LibraryElementImpl getLibrary(String uriStr) { |
| 2691 return _libraryMap.putIfAbsent(uriStr, () { | 2666 return _libraryMap.putIfAbsent(uriStr, () { |
| 2692 var kernel = _kernelMap[uriStr]; | 2667 var kernel = _kernelMap[uriStr]; |
| 2693 if (kernel == null) return null; | 2668 if (kernel == null) return null; |
| 2694 var libraryContext = | 2669 var libraryContext = |
| 2695 new _KernelLibraryResynthesizerContextImpl(this, kernel); | 2670 new _KernelLibraryResynthesizerContextImpl(this, kernel); |
| 2696 return new LibraryElementImpl.forKernel(_analysisContext, libraryContext); | 2671 return new LibraryElementImpl.forKernel(_analysisContext, libraryContext); |
| 2697 }); | 2672 }); |
| 2698 } | 2673 } |
| 2699 } | 2674 } |
| OLD | NEW |