| 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 9591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9602 // This test should verify that we correctly record inferred types, | 9602 // This test should verify that we correctly record inferred types, |
| 9603 // when the type is defined in a part of an SDK library. So, test that | 9603 // when the type is defined in a part of an SDK library. So, test that |
| 9604 // the type is actually in a part. | 9604 // the type is actually in a part. |
| 9605 Element streamElement = p.type.element; | 9605 Element streamElement = p.type.element; |
| 9606 if (streamElement is ClassElement) { | 9606 if (streamElement is ClassElement) { |
| 9607 expect(streamElement.source, isNot(streamElement.library.source)); | 9607 expect(streamElement.source, isNot(streamElement.library.source)); |
| 9608 } | 9608 } |
| 9609 } | 9609 } |
| 9610 | 9610 |
| 9611 void test_inferredType_usesSyntheticFunctionType_functionTypedParam() { | 9611 void test_inferredType_usesSyntheticFunctionType_functionTypedParam() { |
| 9612 // AnalysisContext does not set the enclosing element for the synthetic |
| 9613 // FunctionElement created for the [f, g] type argument. |
| 9614 shouldCompareLibraryElements = false; |
| 9612 var library = checkLibrary(''' | 9615 var library = checkLibrary(''' |
| 9613 int f(int x(String y)) => null; | 9616 int f(int x(String y)) => null; |
| 9614 String g(int x(String y)) => null; | 9617 String g(int x(String y)) => null; |
| 9615 var v = [f, g]; | 9618 var v = [f, g]; |
| 9616 '''); | 9619 '''); |
| 9617 if (isStrongMode) { | 9620 if (isStrongMode) { |
| 9618 checkElementText( | 9621 checkElementText( |
| 9619 library, | 9622 library, |
| 9620 r''' | 9623 r''' |
| 9621 List<((String) → int) → Object> v; | 9624 List<((String) → int) → Object> v; |
| (...skipping 5666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15288 fail('Unexpectedly tried to get unlinked summary for $uri'); | 15291 fail('Unexpectedly tried to get unlinked summary for $uri'); |
| 15289 } | 15292 } |
| 15290 return serializedUnit; | 15293 return serializedUnit; |
| 15291 } | 15294 } |
| 15292 | 15295 |
| 15293 @override | 15296 @override |
| 15294 bool hasLibrarySummary(String uri) { | 15297 bool hasLibrarySummary(String uri) { |
| 15295 return true; | 15298 return true; |
| 15296 } | 15299 } |
| 15297 } | 15300 } |
| OLD | NEW |