Index: pkg/analyzer/test/src/summary/summary_common.dart |
diff --git a/pkg/analyzer/test/src/summary/summary_common.dart b/pkg/analyzer/test/src/summary/summary_common.dart |
index 287b482d7a4913bf3c69c317cd9c721a91f0ec25..9a836bdf6feaf30059f9e2a01c7aa04408865fcb 100644 |
--- a/pkg/analyzer/test/src/summary/summary_common.dart |
+++ b/pkg/analyzer/test/src/summary/summary_common.dart |
@@ -7733,12 +7733,6 @@ class C<T> { |
expect(v.inferredTypeSlot, 0); |
} |
- test_field_propagated_type_final_immediate() { |
- UnlinkedVariable v = |
- serializeClassText('class C { final v = 0; }').fields[0]; |
- checkLinkedTypeSlot(v.propagatedTypeSlot, 'dart:core', 'dart:core', 'int'); |
- } |
- |
test_field_static() { |
UnlinkedVariable variable = |
serializeClassText('class C { static int i; }').fields[0]; |
@@ -7787,24 +7781,6 @@ class C<T> { |
expect(variable.initializer.bodyExpr, isNotNull); |
} |
- test_fully_linked_references_follow_other_references() { |
Paul Berry
2016/08/29 20:52:16
Rather than delete this test we should rewrite it
scheglov
2016/08/29 22:01:47
I restored these 3 tests and changed to use 'infer
|
- if (skipFullyLinkedData) { |
- return; |
- } |
- serializeLibraryText('final x = 0; String y;'); |
- checkLinkedTypeSlot(unlinkedUnits[0].variables[0].propagatedTypeSlot, |
- 'dart:core', 'dart:core', 'int'); |
- checkTypeRef( |
- unlinkedUnits[0].variables[1].type, 'dart:core', 'dart:core', 'String'); |
- // Even though the definition of y follows the definition of x, the linked |
- // type reference for x should use a higher numbered reference than the |
- // unlinked type reference for y. |
- EntityRef propagatedType = |
- getTypeRefForSlot(unlinkedUnits[0].variables[0].propagatedTypeSlot); |
- expect(unlinkedUnits[0].variables[1].type.reference, |
- lessThan(propagatedType.reference)); |
- } |
- |
test_function_documented() { |
String text = ''' |
// Extra comment so doc comment offset != 0 |
@@ -8711,39 +8687,6 @@ int bar;''' |
expect(unlinkedUnits[0].lineStarts, [0, 9, 23, 24]); |
} |
- test_linked_reference_reuse() { |
Paul Berry
2016/08/29 20:52:16
Ditto.
|
- if (skipFullyLinkedData) { |
- return; |
- } |
- // When the reference for a linked type is the same as an explicitly |
- // referenced type, the explicit reference should be re-used. |
- addNamedSource('/a.dart', 'class C {}'); |
- addNamedSource('/b.dart', 'import "a.dart"; C f() => null;'); |
- serializeLibraryText( |
- 'import "a.dart"; import "b.dart"; C c1; final c2 = f();'); |
- int explicitReference = findVariable('c1').type.reference; |
- expect(getTypeRefForSlot(findVariable('c2').propagatedTypeSlot).reference, |
- explicitReference); |
- } |
- |
- test_linked_type_dependency_reuse() { |
Paul Berry
2016/08/29 20:52:16
Ditto.
|
- if (skipFullyLinkedData) { |
- return; |
- } |
- // When the dependency for a linked type is the same as an explicit |
- // dependency, the explicit dependency should be re-used. |
- addNamedSource('/a.dart', 'class C {} class D {}'); |
- addNamedSource('/b.dart', 'import "a.dart"; D f() => null;'); |
- serializeLibraryText( |
- 'import "a.dart"; import "b.dart"; C c; final d = f();'); |
- int cReference = findVariable('c').type.reference; |
- int explicitDependency = linked.units[0].references[cReference].dependency; |
- int dReference = |
- getTypeRefForSlot(findVariable('d').propagatedTypeSlot).reference; |
- expect( |
- linked.units[0].references[dReference].dependency, explicitDependency); |
- } |
- |
test_local_names_take_precedence_over_imported_names() { |
addNamedSource('/a.dart', 'class C {} class D {}'); |
serializeLibraryText(''' |
@@ -9592,38 +9535,6 @@ void f<T, U>(bool b) { |
checkParamTypeRef(inferredType.syntheticParams[1].type, 1); |
} |
- test_syntheticFunctionType_noArguments() { |
- if (skipFullyLinkedData) { |
- return; |
- } |
- UnlinkedVariable variable = serializeVariableText(''' |
-final v = f() ? () => 0 : () => 1; |
-bool f() => true; |
-'''); |
- EntityRef propagatedType = getTypeRefForSlot(variable.propagatedTypeSlot); |
- checkLinkedTypeRef( |
- propagatedType.syntheticReturnType, 'dart:core', 'dart:core', 'int'); |
- expect(propagatedType.syntheticParams, isEmpty); |
- } |
- |
- test_syntheticFunctionType_withArguments() { |
- if (skipFullyLinkedData) { |
- return; |
- } |
- UnlinkedVariable variable = serializeVariableText(''' |
-final v = f() ? (int x, String y) => 0 : (int x, String y) => 1; |
-bool f() => true; |
-'''); |
- EntityRef propagatedType = getTypeRefForSlot(variable.propagatedTypeSlot); |
- checkTypeRef( |
- propagatedType.syntheticReturnType, 'dart:core', 'dart:core', 'int'); |
- expect(propagatedType.syntheticParams, hasLength(2)); |
- checkTypeRef(propagatedType.syntheticParams[0].type, 'dart:core', |
- 'dart:core', 'int'); |
- checkTypeRef(propagatedType.syntheticParams[1].type, 'dart:core', |
- 'dart:core', 'String'); |
- } |
- |
test_type_arguments_explicit() { |
EntityRef typeRef = serializeTypeText('List<int>'); |
checkTypeRef(typeRef, 'dart:core', 'dart:core', 'List', |
@@ -10335,59 +10246,6 @@ var v;'''; |
expect(unlinkedUnits[0].publicNamespace.names, isEmpty); |
} |
- test_variable_propagated_type_final_immediate() { |
- UnlinkedVariable v = serializeVariableText('final v = 0;'); |
- checkLinkedTypeSlot(v.propagatedTypeSlot, 'dart:core', 'dart:core', 'int'); |
- } |
- |
- test_variable_propagated_type_new_reference() { |
- if (skipFullyLinkedData) { |
- return; |
- } |
- UnlinkedVariable v = serializeVariableText('final v = 0;'); |
- // Since the propagated type of `v` is `int`, and there are no references |
- // to `int` elsewhere in the source file, a new linked reference should |
- // have been created for it, with no associated unlinked reference. |
- expect(v.propagatedTypeSlot, isNot(0)); |
- EntityRef type = getTypeRefForSlot(v.propagatedTypeSlot); |
- expect(type, isNotNull); |
- expect(type.reference, |
- greaterThanOrEqualTo(unlinkedUnits[0].references.length)); |
- } |
- |
- test_variable_propagated_type_omit_dynamic() { |
- if (skipFullyLinkedData) { |
- return; |
- } |
- UnlinkedVariable v = serializeVariableText('final v = <int, dynamic>{};'); |
- EntityRef type = getTypeRefForSlot(v.propagatedTypeSlot); |
- checkLinkedTypeRef(type, 'dart:core', 'dart:core', 'Map', |
- numTypeParameters: 2, numTypeArguments: 2); |
- checkLinkedTypeRef(type.typeArguments[0], 'dart:core', 'dart:core', 'int'); |
- checkLinkedDynamicTypeRef(type.typeArguments[1]); |
- } |
- |
- test_variable_propagatedTypeSlot_const() { |
- // Const variables are propagable so they have a nonzero |
- // propagatedTypeSlot. |
- UnlinkedVariable variable = serializeVariableText('const v = 0;'); |
- expect(variable.propagatedTypeSlot, isNot(0)); |
- } |
- |
- test_variable_propagatedTypeSlot_final() { |
- // Final variables are propagable so they have a nonzero |
- // propagatedTypeSlot. |
- UnlinkedVariable variable = serializeVariableText('final v = 0;'); |
- expect(variable.propagatedTypeSlot, isNot(0)); |
- } |
- |
- test_variable_propagatedTypeSlot_non_propagable() { |
- // Non-final non-const variables aren't propagable so they don't have a |
- // propagatedTypeSlot. |
- UnlinkedVariable variable = serializeVariableText('var v;'); |
- expect(variable.propagatedTypeSlot, 0); |
- } |
- |
test_variable_static() { |
UnlinkedVariable variable = |
serializeClassText('class C { static int i; }').fields[0]; |