| 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 test_class_constructor_fieldFormal_optional_noDefault() async { | 204 test_class_constructor_fieldFormal_optional_noDefault() async { |
| 205 await super.test_class_constructor_fieldFormal_optional_noDefault(); | 205 await super.test_class_constructor_fieldFormal_optional_noDefault(); |
| 206 } | 206 } |
| 207 | 207 |
| 208 @failingTest | 208 @failingTest |
| 209 test_class_constructor_fieldFormal_optional_withDefault() async { | 209 test_class_constructor_fieldFormal_optional_withDefault() async { |
| 210 await super.test_class_constructor_fieldFormal_optional_withDefault(); | 210 await super.test_class_constructor_fieldFormal_optional_withDefault(); |
| 211 } | 211 } |
| 212 | 212 |
| 213 @failingTest | 213 @failingTest |
| 214 test_class_constructor_params() async { | |
| 215 await super.test_class_constructor_params(); | |
| 216 } | |
| 217 | |
| 218 @failingTest | |
| 219 test_class_documented_tripleSlash() async { | 214 test_class_documented_tripleSlash() async { |
| 220 await super.test_class_documented_tripleSlash(); | 215 await super.test_class_documented_tripleSlash(); |
| 221 } | 216 } |
| 222 | 217 |
| 223 @failingTest | 218 @failingTest |
| 224 test_class_documented_withLeadingNotDocumentation() async { | 219 test_class_documented_withLeadingNotDocumentation() async { |
| 225 await super.test_class_documented_withLeadingNotDocumentation(); | 220 await super.test_class_documented_withLeadingNotDocumentation(); |
| 226 } | 221 } |
| 227 | 222 |
| 228 @failingTest | 223 @failingTest |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 test_class_implicitField_setterFirst() async { | 274 test_class_implicitField_setterFirst() async { |
| 280 await super.test_class_implicitField_setterFirst(); | 275 await super.test_class_implicitField_setterFirst(); |
| 281 } | 276 } |
| 282 | 277 |
| 283 @failingTest | 278 @failingTest |
| 284 test_class_interfaces_unresolved() async { | 279 test_class_interfaces_unresolved() async { |
| 285 await super.test_class_interfaces_unresolved(); | 280 await super.test_class_interfaces_unresolved(); |
| 286 } | 281 } |
| 287 | 282 |
| 288 @failingTest | 283 @failingTest |
| 289 test_class_method_params() async { | |
| 290 await super.test_class_method_params(); | |
| 291 } | |
| 292 | |
| 293 @failingTest | |
| 294 test_class_mixins() async { | 284 test_class_mixins() async { |
| 295 await super.test_class_mixins(); | 285 await super.test_class_mixins(); |
| 296 } | 286 } |
| 297 | 287 |
| 298 @failingTest | 288 @failingTest |
| 299 test_class_mixins_unresolved() async { | 289 test_class_mixins_unresolved() async { |
| 300 await super.test_class_mixins_unresolved(); | 290 await super.test_class_mixins_unresolved(); |
| 301 } | 291 } |
| 302 | 292 |
| 303 @failingTest | 293 @failingTest |
| (...skipping 1577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1881 test_metadata_typeParameter_ofTypedef() async { | 1871 test_metadata_typeParameter_ofTypedef() async { |
| 1882 await super.test_metadata_typeParameter_ofTypedef(); | 1872 await super.test_metadata_typeParameter_ofTypedef(); |
| 1883 } | 1873 } |
| 1884 | 1874 |
| 1885 @failingTest | 1875 @failingTest |
| 1886 test_method_documented() async { | 1876 test_method_documented() async { |
| 1887 await super.test_method_documented(); | 1877 await super.test_method_documented(); |
| 1888 } | 1878 } |
| 1889 | 1879 |
| 1890 @failingTest | 1880 @failingTest |
| 1891 test_method_inferred_type_nonStatic_implicit_param() async { | |
| 1892 await super.test_method_inferred_type_nonStatic_implicit_param(); | |
| 1893 } | |
| 1894 | |
| 1895 @failingTest | |
| 1896 test_method_type_parameter() async { | 1881 test_method_type_parameter() async { |
| 1897 await super.test_method_type_parameter(); | 1882 await super.test_method_type_parameter(); |
| 1898 } | 1883 } |
| 1899 | 1884 |
| 1900 @failingTest | 1885 @failingTest |
| 1901 test_method_type_parameter_in_generic_class() async { | 1886 test_method_type_parameter_in_generic_class() async { |
| 1902 await super.test_method_type_parameter_in_generic_class(); | 1887 await super.test_method_type_parameter_in_generic_class(); |
| 1903 } | 1888 } |
| 1904 | 1889 |
| 1905 @failingTest | 1890 @failingTest |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1943 test_nested_generic_functions_with_function_typed_param() async { | 1928 test_nested_generic_functions_with_function_typed_param() async { |
| 1944 await super.test_nested_generic_functions_with_function_typed_param(); | 1929 await super.test_nested_generic_functions_with_function_typed_param(); |
| 1945 } | 1930 } |
| 1946 | 1931 |
| 1947 @failingTest | 1932 @failingTest |
| 1948 test_nested_generic_functions_with_local_variables() async { | 1933 test_nested_generic_functions_with_local_variables() async { |
| 1949 await super.test_nested_generic_functions_with_local_variables(); | 1934 await super.test_nested_generic_functions_with_local_variables(); |
| 1950 } | 1935 } |
| 1951 | 1936 |
| 1952 @failingTest | 1937 @failingTest |
| 1953 test_operator() async { | |
| 1954 await super.test_operator(); | |
| 1955 } | |
| 1956 | |
| 1957 @failingTest | |
| 1958 test_operator_equal() async { | |
| 1959 await super.test_operator_equal(); | |
| 1960 } | |
| 1961 | |
| 1962 @failingTest | |
| 1963 test_operator_external() async { | |
| 1964 await super.test_operator_external(); | |
| 1965 } | |
| 1966 | |
| 1967 @failingTest | |
| 1968 test_operator_greater_equal() async { | |
| 1969 await super.test_operator_greater_equal(); | |
| 1970 } | |
| 1971 | |
| 1972 @failingTest | |
| 1973 test_operator_index() async { | |
| 1974 await super.test_operator_index(); | |
| 1975 } | |
| 1976 | |
| 1977 @failingTest | |
| 1978 test_operator_index_set() async { | |
| 1979 await super.test_operator_index_set(); | |
| 1980 } | |
| 1981 | |
| 1982 @failingTest | |
| 1983 test_operator_less_equal() async { | |
| 1984 await super.test_operator_less_equal(); | |
| 1985 } | |
| 1986 | |
| 1987 @failingTest | |
| 1988 test_parameter_checked() async { | 1938 test_parameter_checked() async { |
| 1989 await super.test_parameter_checked(); | 1939 await super.test_parameter_checked(); |
| 1990 } | 1940 } |
| 1991 | 1941 |
| 1992 @failingTest | 1942 @failingTest |
| 1993 test_parameter_checked_inherited() async { | 1943 test_parameter_checked_inherited() async { |
| 1994 await super.test_parameter_checked_inherited(); | 1944 await super.test_parameter_checked_inherited(); |
| 1995 } | 1945 } |
| 1996 | 1946 |
| 1997 @failingTest | 1947 @failingTest |
| (...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2535 return _getInterfaceType( | 2485 return _getInterfaceType( |
| 2536 kernelType.className.canonicalName, kernelType.typeArguments); | 2486 kernelType.className.canonicalName, kernelType.typeArguments); |
| 2537 } | 2487 } |
| 2538 | 2488 |
| 2539 DartType getType(ElementImpl context, kernel.DartType kernelType) { | 2489 DartType getType(ElementImpl context, kernel.DartType kernelType) { |
| 2540 if (kernelType is kernel.DynamicType) return DynamicTypeImpl.instance; | 2490 if (kernelType is kernel.DynamicType) return DynamicTypeImpl.instance; |
| 2541 if (kernelType is kernel.InterfaceType) { | 2491 if (kernelType is kernel.InterfaceType) { |
| 2542 return _getInterfaceType( | 2492 return _getInterfaceType( |
| 2543 kernelType.className.canonicalName, kernelType.typeArguments); | 2493 kernelType.className.canonicalName, kernelType.typeArguments); |
| 2544 } | 2494 } |
| 2495 if (kernelType is kernel.VoidType) return VoidTypeImpl.instance; |
| 2545 // TODO(scheglov) Support other kernel types. | 2496 // TODO(scheglov) Support other kernel types. |
| 2546 throw new UnimplementedError('For ${kernelType.runtimeType}'); | 2497 throw new UnimplementedError('For ${kernelType.runtimeType}'); |
| 2547 } | 2498 } |
| 2548 | 2499 |
| 2549 InterfaceType _getInterfaceType( | 2500 InterfaceType _getInterfaceType( |
| 2550 kernel.CanonicalName className, List<kernel.DartType> kernelArguments) { | 2501 kernel.CanonicalName className, List<kernel.DartType> kernelArguments) { |
| 2551 var libraryName = className.parent; | 2502 var libraryName = className.parent; |
| 2552 var libraryElement = _resynthesizer.getLibrary(libraryName.name); | 2503 var libraryElement = _resynthesizer.getLibrary(libraryName.name); |
| 2553 ClassElementImpl classElement = libraryElement.getType(className.name); | 2504 ClassElementImpl classElement = libraryElement.getType(className.name); |
| 2554 | 2505 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 2576 LibraryElementImpl getLibrary(String uriStr) { | 2527 LibraryElementImpl getLibrary(String uriStr) { |
| 2577 return _libraryMap.putIfAbsent(uriStr, () { | 2528 return _libraryMap.putIfAbsent(uriStr, () { |
| 2578 var kernel = _kernelMap[uriStr]; | 2529 var kernel = _kernelMap[uriStr]; |
| 2579 if (kernel == null) return null; | 2530 if (kernel == null) return null; |
| 2580 var libraryContext = | 2531 var libraryContext = |
| 2581 new _KernelLibraryResynthesizerContextImpl(this, kernel); | 2532 new _KernelLibraryResynthesizerContextImpl(this, kernel); |
| 2582 return new LibraryElementImpl.forKernel(_analysisContext, libraryContext); | 2533 return new LibraryElementImpl.forKernel(_analysisContext, libraryContext); |
| 2583 }); | 2534 }); |
| 2584 } | 2535 } |
| 2585 } | 2536 } |
| OLD | NEW |