Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Unified Diff: pkg/analyzer/test/src/summary/summary_common.dart

Issue 2700843002: Use absolute URIs for LinkedDependency.uri/parts. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 5f69ff10b9c3ef1a245f557091e689fec78b1134..001263ca407c33d4c7871bb88af955cfc6093516 100644
--- a/pkg/analyzer/test/src/summary/summary_common.dart
+++ b/pkg/analyzer/test/src/summary/summary_common.dart
@@ -216,7 +216,7 @@ abstract class SummaryTest {
assertUnlinkedConst(annotations[0], operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'a',
+ (EntityRef r) => checkTypeRef(r, null, 'a',
expectedKind: ReferenceKind.topLevelPropertyAccessor)
]);
}
@@ -238,16 +238,11 @@ abstract class SummaryTest {
/**
* Verify that the [dependency]th element of the dependency table represents
- * a file reachable via the given [absoluteUri] and [relativeUri].
+ * a file reachable via the given [absoluteUri].
*/
- void checkDependency(int dependency, String absoluteUri, String relativeUri) {
+ void checkDependency(int dependency, String absoluteUri) {
expect(dependency, new isInstanceOf<int>());
- if (dependency >= linked.numPrelinkedDependencies) {
- // Fully-linked dependencies are always absolute URIs.
- expect(linked.dependencies[dependency].uri, absoluteUri);
- } else {
- expect(linked.dependencies[dependency].uri, relativeUri);
- }
+ expect(linked.dependencies[dependency].uri, absoluteUri);
}
/**
@@ -284,24 +279,24 @@ abstract class SummaryTest {
* Verify that the given [typeRef] represents the type `dynamic`.
*/
void checkDynamicTypeRef(EntityRef typeRef) {
- checkTypeRef(typeRef, null, null, 'dynamic');
+ checkTypeRef(typeRef, null, 'dynamic');
}
/**
* Verify that the given [exportName] represents a reference to an entity
- * declared in a file reachable via [absoluteUri] and [relativeUri], having
- * name [expectedName]. [expectedKind] is the kind of object referenced.
- * [expectedTargetUnit] is the index of the compilation unit in which the
- * target of the [exportName] is expected to appear; if not specified it is
- * assumed to be the defining compilation unit.
+ * declared in a file reachable via [absoluteUri], having name [expectedName].
+ * [expectedKind] is the kind of object referenced. [expectedTargetUnit] is
+ * the index of the compilation unit in which the target of the [exportName]
+ * is expected to appear; if not specified it is assumed to be the defining
+ * compilation unit.
*/
void checkExportName(LinkedExportName exportName, String absoluteUri,
- String relativeUri, String expectedName, ReferenceKind expectedKind,
+ String expectedName, ReferenceKind expectedKind,
{int expectedTargetUnit: 0}) {
expect(exportName, new isInstanceOf<LinkedExportName>());
// Exported names must come from other libraries.
expect(exportName.dependency, isNot(0));
- checkDependency(exportName.dependency, absoluteUri, relativeUri);
+ checkDependency(exportName.dependency, absoluteUri);
expect(exportName.name, expectedName);
expect(exportName.kind, expectedKind);
expect(exportName.unit, expectedTargetUnit);
@@ -339,7 +334,7 @@ abstract class SummaryTest {
* associated type. Otherwise, behave as in [checkLinkedTypeSlot].
*/
void checkInferredTypeSlot(
- int slotId, String absoluteUri, String relativeUri, String expectedName,
+ int slotId, String absoluteUri, String expectedName,
{int numTypeArguments: 0,
ReferenceKind expectedKind: ReferenceKind.classOrEnum,
int expectedTargetUnit: 0,
@@ -348,7 +343,7 @@ abstract class SummaryTest {
int numTypeParameters: 0,
bool onlyInStrongMode: true}) {
if (strongMode || !onlyInStrongMode) {
- checkLinkedTypeSlot(slotId, absoluteUri, relativeUri, expectedName,
+ checkLinkedTypeSlot(slotId, absoluteUri, expectedName,
numTypeArguments: numTypeArguments,
expectedKind: expectedKind,
expectedTargetUnit: expectedTargetUnit,
@@ -380,24 +375,24 @@ abstract class SummaryTest {
* Verify that the given [typeRef] represents the type `dynamic`.
*/
void checkLinkedDynamicTypeRef(EntityRef typeRef) {
- checkLinkedTypeRef(typeRef, null, null, 'dynamic');
+ checkLinkedTypeRef(typeRef, null, 'dynamic');
}
/**
* Verify that the given [typeRef] represents a reference to a type declared
- * in a file reachable via [absoluteUri] and [relativeUri], having name
- * [expectedName]. Verify that the number of type arguments
- * is equal to [numTypeArguments]. [expectedKind] is the kind of object
- * referenced. [linkedSourceUnit] and [unlinkedSourceUnit] refer to the
- * compilation unit within which the [typeRef] appears; if not specified they
- * are assumed to refer to the defining compilation unit.
- * [expectedTargetUnit] is the index of the compilation unit in which the
- * target of the [typeRef] is expected to appear; if not specified it is
- * assumed to be the defining compilation unit. [numTypeParameters] is the
- * number of type parameters of the thing being referred to.
+ * in a file reachable via [absoluteUri], having name [expectedName]. Verify
+ * that the number of type arguments is equal to [numTypeArguments].
+ * [expectedKind] is the kind of object referenced. [linkedSourceUnit] and
+ * [unlinkedSourceUnit] refer to the compilation unit within which the
+ * [typeRef] appears; if not specified they are assumed to refer to the
+ * defining compilation unit. [expectedTargetUnit] is the index of the
+ * compilation unit in which the target of the [typeRef] is expected to
+ * appear; if not specified it is assumed to be the defining compilation unit.
+ * [numTypeParameters] is the number of type parameters of the thing being
+ * referred to.
*/
- void checkLinkedTypeRef(EntityRef typeRef, String absoluteUri,
- String relativeUri, String expectedName,
+ void checkLinkedTypeRef(
+ EntityRef typeRef, String absoluteUri, String expectedName,
{int numTypeArguments: 0,
ReferenceKind expectedKind: ReferenceKind.classOrEnum,
int expectedTargetUnit: 0,
@@ -410,7 +405,7 @@ abstract class SummaryTest {
expect(typeRef.paramReference, 0);
int index = typeRef.reference;
expect(typeRef.typeArguments, hasLength(numTypeArguments));
- checkReferenceIndex(index, absoluteUri, relativeUri, expectedName,
+ checkReferenceIndex(index, absoluteUri, expectedName,
expectedKind: expectedKind,
expectedTargetUnit: expectedTargetUnit,
linkedSourceUnit: linkedSourceUnit,
@@ -420,19 +415,18 @@ abstract class SummaryTest {
/**
* Verify that the given [slotId] represents a reference to a type declared
- * in a file reachable via [absoluteUri] and [relativeUri], having name
- * [expectedName]. Verify that the number of type arguments
- * is equal to [numTypeArguments]. [expectedKind] is the kind of object
- * referenced. [linkedSourceUnit] and [unlinkedSourceUnit] refer to the
- * compilation unit within which the [typeRef] appears; if not specified they
- * are assumed to refer to the defining compilation unit.
- * [expectedTargetUnit] is the index of the compilation unit in which the
- * target of the [typeRef] is expected to appear; if not specified it is
- * assumed to be the defining compilation unit. [numTypeParameters] is the
- * number of type parameters of the thing being referred to.
+ * in a file reachable via [absoluteUri], having name [expectedName]. Verify
+ * that the number of type arguments is equal to [numTypeArguments].
+ * [expectedKind] is the kind of object referenced. [linkedSourceUnit] and
+ * [unlinkedSourceUnit] refer to the compilation unit within which the
+ * [typeRef] appears; if not specified they are assumed to refer to the
+ * defining compilation unit. [expectedTargetUnit] is the index of the
+ * compilation unit in which the target of the [typeRef] is expected to
+ * appear; if not specified it is assumed to be the defining compilation unit.
+ * [numTypeParameters] is the number of type parameters of the thing being
+ * referred to.
*/
- void checkLinkedTypeSlot(
- int slotId, String absoluteUri, String relativeUri, String expectedName,
+ void checkLinkedTypeSlot(int slotId, String absoluteUri, String expectedName,
{int numTypeArguments: 0,
ReferenceKind expectedKind: ReferenceKind.classOrEnum,
int expectedTargetUnit: 0,
@@ -448,7 +442,6 @@ abstract class SummaryTest {
checkLinkedTypeRef(
getTypeRefForSlot(slotId, linkedSourceUnit: linkedSourceUnit),
absoluteUri,
- relativeUri,
expectedName,
numTypeArguments: numTypeArguments,
expectedKind: expectedKind,
@@ -484,13 +477,13 @@ abstract class SummaryTest {
/**
* Check the data structures that are reachable from an index in the
- * references table.. If the reference in question is an explicit
+ * references table. If the reference in question is an explicit
* reference, return the [UnlinkedReference] that is used to make the
* explicit reference. If the type reference in question is an implicit
* reference, return `null`.
*/
- UnlinkedReference checkReferenceIndex(int referenceIndex, String absoluteUri,
- String relativeUri, String expectedName,
+ UnlinkedReference checkReferenceIndex(
+ int referenceIndex, String absoluteUri, String expectedName,
{ReferenceKind expectedKind: ReferenceKind.classOrEnum,
int expectedTargetUnit: 0,
LinkedUnit linkedSourceUnit,
@@ -525,7 +518,7 @@ abstract class SummaryTest {
if (absoluteUri == null) {
expect(referenceResolution.dependency, 0);
} else {
- checkDependency(referenceResolution.dependency, absoluteUri, relativeUri);
+ checkDependency(referenceResolution.dependency, absoluteUri);
}
if (expectedName == null) {
expect(name, isEmpty);
@@ -541,20 +534,19 @@ abstract class SummaryTest {
/**
* Verify that the given [typeRef] represents a reference to a type declared
- * in a file reachable via [absoluteUri] and [relativeUri], having name
- * [expectedName]. If [expectedPrefix] is supplied, verify that the type is
- * reached via the given prefix. Verify that the number of type arguments
- * is equal to [numTypeArguments]. [expectedKind] is the kind of
- * object referenced. [linkedSourceUnit] and [unlinkedSourceUnit] refer
- * to the compilation unit within which the [typeRef] appears; if not
- * specified they are assumed to refer to the defining compilation unit.
- * [expectedTargetUnit] is the index of the compilation unit in which the
- * target of the [typeRef] is expected to appear; if not specified it is
- * assumed to be the defining compilation unit. [numTypeParameters] is the
- * number of type parameters of the thing being referred to.
+ * in a file reachable via [absoluteUri], having name [expectedName].
+ * If [expectedPrefix] is supplied, verify that the type is reached via the
+ * given prefix. Verify that the number of type arguments is equal to
+ * [numTypeArguments]. [expectedKind] is the kind of object referenced.
+ * [linkedSourceUnit] and [unlinkedSourceUnit] refer to the compilation unit
+ * within which the [typeRef] appears; if not specified they are assumed to
+ * refer to the defining compilation unit. [expectedTargetUnit] is the index
+ * of the compilation unit in which the target of the [typeRef] is expected
+ * to appear; if not specified it is assumed to be the defining compilation
+ * unit. [numTypeParameters] is the number of type parameters of the thing
+ * being referred to.
*/
- void checkTypeRef(EntityRef typeRef, String absoluteUri, String relativeUri,
- String expectedName,
+ void checkTypeRef(EntityRef typeRef, String absoluteUri, String expectedName,
{String expectedPrefix,
List<_PrefixExpectation> prefixExpectations,
int numTypeArguments: 0,
@@ -570,7 +562,7 @@ abstract class SummaryTest {
int index = typeRef.reference;
expect(typeRef.typeArguments, hasLength(numTypeArguments));
UnlinkedReference reference = checkReferenceIndex(
- index, absoluteUri, relativeUri, expectedName,
+ index, absoluteUri, expectedName,
expectedKind: expectedKind,
expectedTargetUnit: expectedTargetUnit,
linkedSourceUnit: linkedSourceUnit,
@@ -585,7 +577,7 @@ abstract class SummaryTest {
for (_PrefixExpectation expectation in prefixExpectations) {
expect(reference.prefixReference, isNot(0));
reference = checkReferenceIndex(reference.prefixReference,
- expectation.absoluteUri, expectation.relativeUri, expectation.name,
+ expectation.absoluteUri, expectation.name,
expectedKind: expectation.kind,
expectedTargetUnit: expectedTargetUnit,
linkedSourceUnit: linkedSourceUnit,
@@ -607,7 +599,7 @@ abstract class SummaryTest {
{LinkedUnit linkedSourceUnit, UnlinkedUnit unlinkedSourceUnit}) {
// When serializing from the element model, unresolved type refs lose their
// name.
- checkTypeRef(typeRef, null, null, expectedName,
+ checkTypeRef(typeRef, null, expectedName,
expectedPrefix: expectedPrefix,
expectedKind: ReferenceKind.unresolved,
linkedSourceUnit: linkedSourceUnit,
@@ -618,7 +610,7 @@ abstract class SummaryTest {
* Verify that the given [typeRef] represents the type `void`.
*/
void checkVoidTypeRef(EntityRef typeRef) {
- checkTypeRef(typeRef, null, null, 'void');
+ checkTypeRef(typeRef, null, 'void');
}
fail_invalid_prefix_dynamic() {
@@ -1009,8 +1001,7 @@ B b;
C c;
''',
allowErrors: true);
- checkTypeRef(
- findVariable('a').type, absUri('/lib2.dart'), 'lib2.dart', 'A');
+ checkTypeRef(findVariable('a').type, absUri('/lib2.dart'), 'A');
checkUnresolvedTypeRef(findVariable('b').type, null, 'B');
checkUnresolvedTypeRef(findVariable('c').type, null, 'C');
}
@@ -1026,8 +1017,7 @@ B b;
C c;
''',
allowErrors: true);
- checkTypeRef(
- findVariable('a').type, absUri('/lib2.dart'), 'lib2.dart', 'A');
+ checkTypeRef(findVariable('a').type, absUri('/lib2.dart'), 'A');
checkUnresolvedTypeRef(findVariable('b').type, null, 'B');
checkUnresolvedTypeRef(findVariable('c').type, null, 'C');
}
@@ -1043,8 +1033,7 @@ B b;
C c;
''',
allowErrors: true);
- checkTypeRef(
- findVariable('a').type, absUri('/lib2.dart'), 'lib2.dart', 'A');
+ checkTypeRef(findVariable('a').type, absUri('/lib2.dart'), 'A');
checkUnresolvedTypeRef(findVariable('b').type, null, 'B');
checkUnresolvedTypeRef(findVariable('c').type, null, 'C');
}
@@ -1060,8 +1049,7 @@ B b;
C c;
''',
allowErrors: true);
- checkTypeRef(
- findVariable('a').type, absUri('/lib2.dart'), 'lib2.dart', 'A');
+ checkTypeRef(findVariable('a').type, absUri('/lib2.dart'), 'A');
checkUnresolvedTypeRef(findVariable('b').type, null, 'B');
checkUnresolvedTypeRef(findVariable('c').type, null, 'C');
}
@@ -1076,7 +1064,7 @@ B b;
C c;
''',
allowErrors: true);
- checkTypeRef(findVariable('a').type, absUri('/lib.dart'), 'lib.dart', 'A');
+ checkTypeRef(findVariable('a').type, absUri('/lib.dart'), 'A');
checkUnresolvedTypeRef(findVariable('b').type, null, 'B');
checkUnresolvedTypeRef(findVariable('c').type, null, 'C');
}
@@ -1091,7 +1079,7 @@ B b;
C c;
''',
allowErrors: true);
- checkTypeRef(findVariable('a').type, absUri('/lib.dart'), 'lib.dart', 'A');
+ checkTypeRef(findVariable('a').type, absUri('/lib.dart'), 'A');
checkUnresolvedTypeRef(findVariable('b').type, null, 'B');
checkUnresolvedTypeRef(findVariable('c').type, null, 'C');
}
@@ -1106,7 +1094,7 @@ B b;
C c;
''',
allowErrors: true);
- checkTypeRef(findVariable('a').type, absUri('/lib.dart'), 'lib.dart', 'A');
+ checkTypeRef(findVariable('a').type, absUri('/lib.dart'), 'A');
checkUnresolvedTypeRef(findVariable('b').type, null, 'B');
checkUnresolvedTypeRef(findVariable('c').type, null, 'C');
}
@@ -1121,7 +1109,7 @@ B b;
C c;
''',
allowErrors: true);
- checkTypeRef(findVariable('a').type, absUri('/lib.dart'), 'lib.dart', 'A');
+ checkTypeRef(findVariable('a').type, absUri('/lib.dart'), 'A');
checkUnresolvedTypeRef(findVariable('b').type, null, 'B');
checkUnresolvedTypeRef(findVariable('c').type, null, 'C');
}
@@ -1183,8 +1171,8 @@ class E {}
class F {}
''');
expect(cls.mixins, hasLength(2));
- checkTypeRef(cls.mixins[0], null, null, 'E');
- checkTypeRef(cls.mixins[1], null, null, 'F');
+ checkTypeRef(cls.mixins[0], null, 'E');
+ checkTypeRef(cls.mixins[1], null, 'F');
}
test_class_alias_no_implicit_constructors() {
@@ -1208,7 +1196,7 @@ class E {}
test_class_alias_reference_generic() {
EntityRef typeRef = serializeTypeText('C',
otherDeclarations: 'class C<D, E> = F with G; class F {} class G {}');
- checkTypeRef(typeRef, null, null, 'C', numTypeParameters: 2);
+ checkTypeRef(typeRef, null, 'C', numTypeParameters: 2);
}
test_class_alias_reference_generic_imported() {
@@ -1216,14 +1204,13 @@ class E {}
'/lib.dart', 'class C<D, E> = F with G; class F {} class G {}');
EntityRef typeRef =
serializeTypeText('C', otherDeclarations: 'import "lib.dart";');
- checkTypeRef(typeRef, absUri('/lib.dart'), 'lib.dart', 'C',
- numTypeParameters: 2);
+ checkTypeRef(typeRef, absUri('/lib.dart'), 'C', numTypeParameters: 2);
}
test_class_alias_supertype() {
UnlinkedClass cls =
serializeClassText('class C = D with E; class D {} class E {}');
- checkTypeRef(cls.supertype, null, null, 'D');
+ checkTypeRef(cls.supertype, null, 'D');
expect(cls.hasNoSupertype, isFalse);
}
@@ -1372,7 +1359,7 @@ class C implements D {}
class D {}
''');
expect(cls.interfaces, hasLength(1));
- checkTypeRef(cls.interfaces[0], null, null, 'D');
+ checkTypeRef(cls.interfaces[0], null, 'D');
}
test_class_interface_order() {
@@ -1382,8 +1369,8 @@ class D {}
class E {}
''');
expect(cls.interfaces, hasLength(2));
- checkTypeRef(cls.interfaces[0], null, null, 'D');
- checkTypeRef(cls.interfaces[1], null, null, 'E');
+ checkTypeRef(cls.interfaces[0], null, 'D');
+ checkTypeRef(cls.interfaces[1], null, 'E');
}
test_class_mixin() {
@@ -1392,7 +1379,7 @@ class C extends Object with D {}
class D {}
''');
expect(cls.mixins, hasLength(1));
- checkTypeRef(cls.mixins[0], null, null, 'D');
+ checkTypeRef(cls.mixins[0], null, 'D');
}
test_class_mixin_order() {
@@ -1402,8 +1389,8 @@ class D {}
class E {}
''');
expect(cls.mixins, hasLength(2));
- checkTypeRef(cls.mixins[0], null, null, 'D');
- checkTypeRef(cls.mixins[1], null, null, 'E');
+ checkTypeRef(cls.mixins[0], null, 'D');
+ checkTypeRef(cls.mixins[1], null, 'E');
}
test_class_name() {
@@ -1449,15 +1436,14 @@ class E {}
test_class_reference_generic() {
EntityRef typeRef =
serializeTypeText('C', otherDeclarations: 'class C<D, E> {}');
- checkTypeRef(typeRef, null, null, 'C', numTypeParameters: 2);
+ checkTypeRef(typeRef, null, 'C', numTypeParameters: 2);
}
test_class_reference_generic_imported() {
addNamedSource('/lib.dart', 'class C<D, E> {}');
EntityRef typeRef =
serializeTypeText('C', otherDeclarations: 'import "lib.dart";');
- checkTypeRef(typeRef, absUri('/lib.dart'), 'lib.dart', 'C',
- numTypeParameters: 2);
+ checkTypeRef(typeRef, absUri('/lib.dart'), 'C', numTypeParameters: 2);
}
test_class_superclass() {
@@ -1469,7 +1455,7 @@ class E {}
test_class_superclass_explicit() {
UnlinkedClass cls = serializeClassText('class C extends D {} class D {}');
expect(cls.supertype, isNotNull);
- checkTypeRef(cls.supertype, null, null, 'D');
+ checkTypeRef(cls.supertype, null, 'D');
expect(cls.hasNoSupertype, isFalse);
}
@@ -1480,7 +1466,7 @@ class E {}
UnlinkedTypeParam typeParameter = cls.typeParameters[0];
expect(typeParameter.name, 'T');
expect(typeParameter.bound, isNotNull);
- checkTypeRef(typeParameter.bound, 'dart:core', 'dart:core', 'List',
+ checkTypeRef(typeParameter.bound, 'dart:core', 'List',
numTypeParameters: 1);
}
}
@@ -1524,8 +1510,7 @@ class E {}
expect(getTypeRefForSlot(closure.inferredReturnTypeSlot), isNull);
} else {
// Spec mode infers a type for the closure of `() => Bottom`.
- checkInferredTypeSlot(
- closure.inferredReturnTypeSlot, null, null, '*bottom*',
+ checkInferredTypeSlot(closure.inferredReturnTypeSlot, null, '*bottom*',
onlyInStrongMode: false);
}
}
@@ -1543,9 +1528,9 @@ var v = (() {
expect(executable.localFunctions, hasLength(1));
expect(executable.localFunctions[0].returnType, isNull);
checkInferredTypeSlot(executable.localFunctions[0].inferredReturnTypeSlot,
- absUri('/a.dart'), 'a.dart', 'D',
+ absUri('/a.dart'), 'D',
onlyInStrongMode: false);
- checkHasDependency('a.dart', fullyLinked: false);
+ checkHasDependency(absUri('/a.dart'), fullyLinked: false);
}
test_closure_executable_with_return_type_from_closure() {
@@ -1563,15 +1548,15 @@ f() {
expect(executable.localFunctions, hasLength(2));
EntityRef closureType =
getTypeRefForSlot(executable.localFunctions[1].inferredReturnTypeSlot);
- checkLinkedTypeRef(closureType, null, null, '',
+ checkLinkedTypeRef(closureType, null, '',
expectedKind: ReferenceKind.function);
int outerClosureIndex =
definingUnit.references[closureType.reference].containingReference;
- checkReferenceIndex(outerClosureIndex, null, null, '',
+ checkReferenceIndex(outerClosureIndex, null, '',
expectedKind: ReferenceKind.function, localIndex: 1);
int topLevelFunctionIndex =
definingUnit.references[outerClosureIndex].containingReference;
- checkReferenceIndex(topLevelFunctionIndex, null, null, 'f',
+ checkReferenceIndex(topLevelFunctionIndex, null, 'f',
expectedKind: ReferenceKind.topLevelFunction);
expect(
definingUnit.references[topLevelFunctionIndex].containingReference, 0);
@@ -1591,7 +1576,7 @@ var v = (() {
expect(executable.localFunctions, hasLength(1));
expect(executable.localFunctions[0].returnType, isNull);
checkInferredTypeSlot(executable.localFunctions[0].inferredReturnTypeSlot,
- absUri('/b.dart'), 'b.dart', 'D',
+ absUri('/b.dart'), 'D',
onlyInStrongMode: false);
if (!skipFullyLinkedData) {
checkHasDependency('b.dart', fullyLinked: true);
@@ -1852,7 +1837,7 @@ class C<T> {
UnlinkedExprOperation.pushReference
],
referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'T',
+ (EntityRef r) => checkTypeRef(r, null, 'T',
expectedKind: ReferenceKind.propertyAccessor,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.classOrEnum, 'C',
@@ -1942,7 +1927,7 @@ foo(a, b) {}
0
],
referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'foo',
+ (EntityRef r) => checkTypeRef(r, null, 'foo',
expectedKind: ReferenceKind.topLevelFunction)
]);
}
@@ -1974,7 +1959,7 @@ foo(a, b, c) {}
0
],
referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'foo',
+ (EntityRef r) => checkTypeRef(r, null, 'foo',
expectedKind: ReferenceKind.topLevelFunction)
]);
}
@@ -2014,15 +1999,15 @@ const v = const C<int, String>.named();
0
], referenceValidators: [
(EntityRef r) {
- checkTypeRef(r, null, null, 'named',
+ checkTypeRef(r, null, 'named',
expectedKind: ReferenceKind.constructor,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.classOrEnum, 'C',
numTypeParameters: 2)
],
numTypeArguments: 2);
- checkTypeRef(r.typeArguments[0], 'dart:core', 'dart:core', 'int');
- checkTypeRef(r.typeArguments[1], 'dart:core', 'dart:core', 'String');
+ checkTypeRef(r.typeArguments[0], 'dart:core', 'int');
+ checkTypeRef(r.typeArguments[1], 'dart:core', 'String');
}
]);
}
@@ -2046,17 +2031,15 @@ const v = const C<int, String>.named();
0
], referenceValidators: [
(EntityRef r) {
- checkTypeRef(r, null, null, 'named',
+ checkTypeRef(r, null, 'named',
expectedKind: ReferenceKind.constructor,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.classOrEnum, 'C',
- absoluteUri: absUri('/a.dart'),
- relativeUri: 'a.dart',
- numTypeParameters: 2)
+ absoluteUri: absUri('/a.dart'), numTypeParameters: 2)
],
numTypeArguments: 2);
- checkTypeRef(r.typeArguments[0], 'dart:core', 'dart:core', 'int');
- checkTypeRef(r.typeArguments[1], 'dart:core', 'dart:core', 'String');
+ checkTypeRef(r.typeArguments[0], 'dart:core', 'int');
+ checkTypeRef(r.typeArguments[1], 'dart:core', 'String');
}
]);
}
@@ -2080,18 +2063,16 @@ const v = const p.C<int, String>.named();
0
], referenceValidators: [
(EntityRef r) {
- checkTypeRef(r, null, null, 'named',
+ checkTypeRef(r, null, 'named',
expectedKind: ReferenceKind.constructor,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.classOrEnum, 'C',
- absoluteUri: absUri('/a.dart'),
- relativeUri: 'a.dart',
- numTypeParameters: 2),
+ absoluteUri: absUri('/a.dart'), numTypeParameters: 2),
new _PrefixExpectation(ReferenceKind.prefix, 'p')
],
numTypeArguments: 2);
- checkTypeRef(r.typeArguments[0], 'dart:core', 'dart:core', 'int');
- checkTypeRef(r.typeArguments[1], 'dart:core', 'dart:core', 'String');
+ checkTypeRef(r.typeArguments[0], 'dart:core', 'int');
+ checkTypeRef(r.typeArguments[1], 'dart:core', 'String');
}
]);
}
@@ -2110,12 +2091,12 @@ const v = const C<int, String>();
0
], referenceValidators: [
(EntityRef r) {
- checkTypeRef(r, null, null, 'C',
+ checkTypeRef(r, null, 'C',
expectedKind: ReferenceKind.classOrEnum,
numTypeParameters: 2,
numTypeArguments: 2);
- checkTypeRef(r.typeArguments[0], 'dart:core', 'dart:core', 'int');
- checkTypeRef(r.typeArguments[1], 'dart:core', 'dart:core', 'String');
+ checkTypeRef(r.typeArguments[0], 'dart:core', 'int');
+ checkTypeRef(r.typeArguments[1], 'dart:core', 'String');
}
]);
}
@@ -2139,12 +2120,12 @@ const v = const C<int, String>();
0
], referenceValidators: [
(EntityRef r) {
- checkTypeRef(r, absUri('/a.dart'), 'a.dart', 'C',
+ checkTypeRef(r, absUri('/a.dart'), 'C',
expectedKind: ReferenceKind.classOrEnum,
numTypeParameters: 2,
numTypeArguments: 2);
- checkTypeRef(r.typeArguments[0], 'dart:core', 'dart:core', 'int');
- checkTypeRef(r.typeArguments[1], 'dart:core', 'dart:core', 'String');
+ checkTypeRef(r.typeArguments[0], 'dart:core', 'int');
+ checkTypeRef(r.typeArguments[1], 'dart:core', 'String');
}
]);
}
@@ -2168,15 +2149,15 @@ const v = const p.C<int, String>();
0
], referenceValidators: [
(EntityRef r) {
- checkTypeRef(r, absUri('/a.dart'), 'a.dart', 'C',
+ checkTypeRef(r, absUri('/a.dart'), 'C',
expectedKind: ReferenceKind.classOrEnum,
numTypeParameters: 2,
numTypeArguments: 2,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.prefix, 'p')
]);
- checkTypeRef(r.typeArguments[0], 'dart:core', 'dart:core', 'int');
- checkTypeRef(r.typeArguments[1], 'dart:core', 'dart:core', 'String');
+ checkTypeRef(r.typeArguments[0], 'dart:core', 'int');
+ checkTypeRef(r.typeArguments[1], 'dart:core', 'String');
}
]);
}
@@ -2194,7 +2175,7 @@ const v = const C.named();
0,
0
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'named',
+ (EntityRef r) => checkTypeRef(r, null, 'named',
expectedKind: ReferenceKind.constructor,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.classOrEnum, 'C')
@@ -2220,11 +2201,11 @@ const v = const C.named();
0,
0
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'named',
+ (EntityRef r) => checkTypeRef(r, null, 'named',
expectedKind: ReferenceKind.constructor,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.classOrEnum, 'C',
- absoluteUri: absUri('/a.dart'), relativeUri: 'a.dart')
+ absoluteUri: absUri('/a.dart'))
])
]);
}
@@ -2247,11 +2228,11 @@ const v = const p.C.named();
0,
0
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'named',
+ (EntityRef r) => checkTypeRef(r, null, 'named',
expectedKind: ReferenceKind.constructor,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.classOrEnum, 'C',
- absoluteUri: absUri('/a.dart'), relativeUri: 'a.dart'),
+ absoluteUri: absUri('/a.dart')),
new _PrefixExpectation(ReferenceKind.prefix, 'p')
])
]);
@@ -2293,8 +2274,8 @@ const v = const C(11, 22, 3.3, '444', e: 55, g: '777', f: 66);
'g',
'f'
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'C',
- expectedKind: ReferenceKind.classOrEnum)
+ (EntityRef r) =>
+ checkTypeRef(r, null, 'C', expectedKind: ReferenceKind.classOrEnum)
]);
}
@@ -2316,7 +2297,7 @@ const v = const C();
0,
0
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, absUri('/a.dart'), 'a.dart', 'C',
+ (EntityRef r) => checkTypeRef(r, absUri('/a.dart'), 'C',
expectedKind: ReferenceKind.classOrEnum)
]);
}
@@ -2339,7 +2320,7 @@ const v = const p.C();
0,
0
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, absUri('/a.dart'), 'a.dart', 'C',
+ (EntityRef r) => checkTypeRef(r, absUri('/a.dart'), 'C',
expectedKind: ReferenceKind.classOrEnum,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.prefix, 'p')
@@ -2360,7 +2341,7 @@ const v = const C.foo();
0,
0
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'foo',
+ (EntityRef r) => checkTypeRef(r, null, 'foo',
expectedKind: ReferenceKind.unresolved,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.classOrEnum, 'C')
@@ -2380,7 +2361,7 @@ const v = const C.foo();
0,
0
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'foo',
+ (EntityRef r) => checkTypeRef(r, null, 'foo',
expectedKind: ReferenceKind.unresolved,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.unresolved, 'C')
@@ -2407,11 +2388,11 @@ const v = const p.C.foo();
0,
0
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'foo',
+ (EntityRef r) => checkTypeRef(r, null, 'foo',
expectedKind: ReferenceKind.unresolved,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.classOrEnum, 'C',
- absoluteUri: absUri('/a.dart'), relativeUri: 'a.dart'),
+ absoluteUri: absUri('/a.dart')),
new _PrefixExpectation(ReferenceKind.prefix, 'p')
])
]);
@@ -2431,7 +2412,7 @@ const v = const p.C.foo();
0,
0
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'foo',
+ (EntityRef r) => checkTypeRef(r, null, 'foo',
expectedKind: ReferenceKind.unresolved,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.unresolved, 'C'),
@@ -2452,8 +2433,8 @@ const v = const Foo();
0,
0
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'Foo',
- expectedKind: ReferenceKind.unresolved)
+ (EntityRef r) =>
+ checkTypeRef(r, null, 'Foo', expectedKind: ReferenceKind.unresolved)
]);
}
@@ -2471,7 +2452,7 @@ const v = const Foo();
0
], referenceValidators: [
(EntityRef r) {
- checkTypeRef(r, 'dart:core', 'dart:core', 'identical',
+ checkTypeRef(r, 'dart:core', 'identical',
expectedKind: ReferenceKind.topLevelFunction);
}
]);
@@ -2487,7 +2468,7 @@ const int v = C.length;
assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'length',
+ (EntityRef r) => checkTypeRef(r, null, 'length',
expectedKind: ReferenceKind.propertyAccessor,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.classOrEnum, 'C')
@@ -2510,11 +2491,11 @@ const int v = p.C.length;
assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'length',
+ (EntityRef r) => checkTypeRef(r, null, 'length',
expectedKind: ReferenceKind.propertyAccessor,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.classOrEnum, 'C',
- absoluteUri: absUri('/a.dart'), relativeUri: 'a.dart'),
+ absoluteUri: absUri('/a.dart')),
new _PrefixExpectation(ReferenceKind.prefix, 'p')
])
]);
@@ -2528,7 +2509,7 @@ const int v = a.length;
assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'length',
+ (EntityRef r) => checkTypeRef(r, null, 'length',
expectedKind: ReferenceKind.unresolved,
unresolvedHasName: true,
prefixExpectations: [
@@ -2548,7 +2529,7 @@ const int v = C.F.length;
assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'length',
+ (EntityRef r) => checkTypeRef(r, null, 'length',
expectedKind: ReferenceKind.unresolved,
unresolvedHasName: true,
prefixExpectations: [
@@ -2571,13 +2552,13 @@ const int v = a.length;
assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'length',
+ (EntityRef r) => checkTypeRef(r, null, 'length',
expectedKind: ReferenceKind.unresolved,
unresolvedHasName: true,
prefixExpectations: [
new _PrefixExpectation(
ReferenceKind.topLevelPropertyAccessor, 'a',
- absoluteUri: absUri('/a.dart'), relativeUri: 'a.dart')
+ absoluteUri: absUri('/a.dart'))
])
]);
}
@@ -2595,13 +2576,13 @@ const int v = p.a.length;
assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'length',
+ (EntityRef r) => checkTypeRef(r, null, 'length',
expectedKind: ReferenceKind.unresolved,
unresolvedHasName: true,
prefixExpectations: [
new _PrefixExpectation(
ReferenceKind.topLevelPropertyAccessor, 'a',
- absoluteUri: absUri('/a.dart'), relativeUri: 'a.dart'),
+ absoluteUri: absUri('/a.dart')),
new _PrefixExpectation(ReferenceKind.prefix, 'p')
])
]);
@@ -2666,7 +2647,7 @@ const int v = p.a.length;
33,
3
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, 'dart:core', 'dart:core', 'int',
+ (EntityRef r) => checkTypeRef(r, 'dart:core', 'int',
expectedKind: ReferenceKind.classOrEnum)
]);
}
@@ -2710,9 +2691,9 @@ const int v = p.a.length;
'bbb',
'ccc'
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, 'dart:core', 'dart:core', 'int',
+ (EntityRef r) => checkTypeRef(r, 'dart:core', 'int',
expectedKind: ReferenceKind.classOrEnum),
- (EntityRef r) => checkTypeRef(r, 'dart:core', 'dart:core', 'String',
+ (EntityRef r) => checkTypeRef(r, 'dart:core', 'String',
expectedKind: ReferenceKind.classOrEnum)
]);
}
@@ -2906,8 +2887,8 @@ const v = C;
assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'C',
- expectedKind: ReferenceKind.classOrEnum)
+ (EntityRef r) =>
+ checkTypeRef(r, null, 'C', expectedKind: ReferenceKind.classOrEnum)
]);
}
@@ -2919,8 +2900,8 @@ const v = C;
assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'C',
- expectedKind: ReferenceKind.classOrEnum)
+ (EntityRef r) =>
+ checkTypeRef(r, null, 'C', expectedKind: ReferenceKind.classOrEnum)
]);
}
@@ -2932,7 +2913,7 @@ const v = C.V1;
assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'V1',
+ (EntityRef r) => checkTypeRef(r, null, 'V1',
expectedKind: ReferenceKind.propertyAccessor,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.classOrEnum, 'C')
@@ -2953,11 +2934,11 @@ const v = C.V1;
assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'V1',
+ (EntityRef r) => checkTypeRef(r, null, 'V1',
expectedKind: ReferenceKind.propertyAccessor,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.classOrEnum, 'C',
- absoluteUri: absUri('/a.dart'), relativeUri: 'a.dart')
+ absoluteUri: absUri('/a.dart'))
])
]);
}
@@ -2970,7 +2951,7 @@ const v = C.values;
assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'values',
+ (EntityRef r) => checkTypeRef(r, null, 'values',
expectedKind: ReferenceKind.propertyAccessor,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.classOrEnum, 'C')
@@ -2991,11 +2972,11 @@ const v = C.values;
assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'values',
+ (EntityRef r) => checkTypeRef(r, null, 'values',
expectedKind: ReferenceKind.propertyAccessor,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.classOrEnum, 'C',
- absoluteUri: absUri('/a.dart'), relativeUri: 'a.dart')
+ absoluteUri: absUri('/a.dart'))
])
]);
}
@@ -3010,7 +2991,7 @@ const v = C.F;
assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'F',
+ (EntityRef r) => checkTypeRef(r, null, 'F',
expectedKind: ReferenceKind.propertyAccessor,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.classOrEnum, 'C')
@@ -3033,11 +3014,11 @@ const v = C.F;
assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'F',
+ (EntityRef r) => checkTypeRef(r, null, 'F',
expectedKind: ReferenceKind.propertyAccessor,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.classOrEnum, 'C',
- absoluteUri: absUri('/a.dart'), relativeUri: 'a.dart')
+ absoluteUri: absUri('/a.dart'))
])
]);
}
@@ -3057,11 +3038,11 @@ const v = p.C.F;
assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'F',
+ (EntityRef r) => checkTypeRef(r, null, 'F',
expectedKind: ReferenceKind.propertyAccessor,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.classOrEnum, 'C',
- absoluteUri: absUri('/a.dart'), relativeUri: 'a.dart'),
+ absoluteUri: absUri('/a.dart')),
new _PrefixExpectation(ReferenceKind.prefix, 'p'),
])
]);
@@ -3077,7 +3058,7 @@ class C {
assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'b',
+ (EntityRef r) => checkTypeRef(r, null, 'b',
expectedKind: ReferenceKind.propertyAccessor,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.classOrEnum, 'C')
@@ -3095,7 +3076,7 @@ const v = C.x;
assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'x',
+ (EntityRef r) => checkTypeRef(r, null, 'x',
expectedKind: ReferenceKind.propertyAccessor,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.classOrEnum, 'C')
@@ -3118,11 +3099,11 @@ const v = C.x;
assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'x',
+ (EntityRef r) => checkTypeRef(r, null, 'x',
expectedKind: ReferenceKind.propertyAccessor,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.classOrEnum, 'C',
- absoluteUri: absUri('/a.dart'), relativeUri: 'a.dart')
+ absoluteUri: absUri('/a.dart'))
])
]);
}
@@ -3142,11 +3123,11 @@ const v = p.C.x;
assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'x',
+ (EntityRef r) => checkTypeRef(r, null, 'x',
expectedKind: ReferenceKind.propertyAccessor,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.classOrEnum, 'C',
- absoluteUri: absUri('/a.dart'), relativeUri: 'a.dart'),
+ absoluteUri: absUri('/a.dart')),
new _PrefixExpectation(ReferenceKind.prefix, 'p')
])
]);
@@ -3162,7 +3143,7 @@ const v = C.m;
assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'm',
+ (EntityRef r) => checkTypeRef(r, null, 'm',
expectedKind: ReferenceKind.method,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.classOrEnum, 'C')
@@ -3185,11 +3166,11 @@ const v = C.m;
assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'm',
+ (EntityRef r) => checkTypeRef(r, null, 'm',
expectedKind: ReferenceKind.method,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.classOrEnum, 'C',
- absoluteUri: absUri('/a.dart'), relativeUri: 'a.dart')
+ absoluteUri: absUri('/a.dart'))
])
]);
}
@@ -3209,11 +3190,11 @@ const v = p.C.m;
assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'm',
+ (EntityRef r) => checkTypeRef(r, null, 'm',
expectedKind: ReferenceKind.method,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.classOrEnum, 'C',
- absoluteUri: absUri('/a.dart'), relativeUri: 'a.dart'),
+ absoluteUri: absUri('/a.dart')),
new _PrefixExpectation(ReferenceKind.prefix, 'p')
])
]);
@@ -3229,7 +3210,7 @@ class C {
assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'm',
+ (EntityRef r) => checkTypeRef(r, null, 'm',
expectedKind: ReferenceKind.method,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.classOrEnum, 'C')
@@ -3245,7 +3226,7 @@ const v = f;
assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'f',
+ (EntityRef r) => checkTypeRef(r, null, 'f',
expectedKind: ReferenceKind.topLevelFunction)
]);
}
@@ -3263,7 +3244,7 @@ const v = f;
assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, absUri('/a.dart'), 'a.dart', 'f',
+ (EntityRef r) => checkTypeRef(r, absUri('/a.dart'), 'f',
expectedKind: ReferenceKind.topLevelFunction)
]);
}
@@ -3281,7 +3262,7 @@ const v = p.f;
assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, absUri('/a.dart'), 'a.dart', 'f',
+ (EntityRef r) => checkTypeRef(r, absUri('/a.dart'), 'f',
expectedKind: ReferenceKind.topLevelFunction,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.prefix, 'p')
@@ -3297,7 +3278,7 @@ const v = x;
assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'x',
+ (EntityRef r) => checkTypeRef(r, null, 'x',
expectedKind: ReferenceKind.topLevelPropertyAccessor)
]);
}
@@ -3311,7 +3292,7 @@ const v = x;
assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, absUri('/a.dart'), 'a.dart', 'x',
+ (EntityRef r) => checkTypeRef(r, absUri('/a.dart'), 'x',
expectedKind: ReferenceKind.topLevelPropertyAccessor)
]);
}
@@ -3325,7 +3306,7 @@ const v = p.x;
assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, absUri('/a.dart'), 'a.dart', 'x',
+ (EntityRef r) => checkTypeRef(r, absUri('/a.dart'), 'x',
expectedKind: ReferenceKind.topLevelPropertyAccessor,
expectedPrefix: 'p')
]);
@@ -3339,7 +3320,7 @@ const v = a;
assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'a',
+ (EntityRef r) => checkTypeRef(r, null, 'a',
expectedKind: ReferenceKind.topLevelPropertyAccessor)
]);
}
@@ -3353,7 +3334,7 @@ const v = a;
assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, absUri('/a.dart'), 'a.dart', 'a',
+ (EntityRef r) => checkTypeRef(r, absUri('/a.dart'), 'a',
expectedKind: ReferenceKind.topLevelPropertyAccessor)
]);
}
@@ -3368,7 +3349,7 @@ const v = p.a;
UnlinkedExprOperation.pushReference
], referenceValidators: [
(EntityRef r) {
- return checkTypeRef(r, absUri('/a.dart'), 'a.dart', 'a',
+ return checkTypeRef(r, absUri('/a.dart'), 'a',
expectedKind: ReferenceKind.topLevelPropertyAccessor,
expectedPrefix: 'p');
}
@@ -3401,8 +3382,8 @@ const v = foo;
assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'foo',
- expectedKind: ReferenceKind.unresolved)
+ (EntityRef r) =>
+ checkTypeRef(r, null, 'foo', expectedKind: ReferenceKind.unresolved)
]);
}
@@ -3416,7 +3397,7 @@ const v = C.foo;
assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'foo',
+ (EntityRef r) => checkTypeRef(r, null, 'foo',
expectedKind: ReferenceKind.unresolved,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.classOrEnum, 'C')
@@ -3439,11 +3420,11 @@ const v = p.C.foo;
assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'foo',
+ (EntityRef r) => checkTypeRef(r, null, 'foo',
expectedKind: ReferenceKind.unresolved,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.classOrEnum, 'C',
- absoluteUri: absUri('/a.dart'), relativeUri: 'a.dart'),
+ absoluteUri: absUri('/a.dart')),
new _PrefixExpectation(ReferenceKind.prefix, 'p'),
])
]);
@@ -3843,7 +3824,7 @@ class C {
executables: serializeClassText('class C { C(int this.x); final x; }')
.executables);
UnlinkedParam parameter = executable.parameters[0];
- checkTypeRef(parameter.type, 'dart:core', 'dart:core', 'int');
+ checkTypeRef(parameter.type, 'dart:core', 'int');
}
test_constructor_initializing_formal_function_typed() {
@@ -3860,7 +3841,7 @@ class C {
serializeClassText('class C { C(int this.x()); Function x; }')
.executables);
UnlinkedParam parameter = executable.parameters[0];
- checkTypeRef(parameter.type, 'dart:core', 'dart:core', 'int');
+ checkTypeRef(parameter.type, 'dart:core', 'int');
}
test_constructor_initializing_formal_function_typed_implicit_return_type() {
@@ -3914,7 +3895,7 @@ int foo() => 0;
assertUnlinkedConst(param.initializer.bodyExpr, operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'foo',
+ (EntityRef r) => checkTypeRef(r, null, 'foo',
expectedKind: ReferenceKind.topLevelFunction)
]);
}
@@ -4082,7 +4063,7 @@ class D extends C {
expect(executable.isRedirectedConstructor, isTrue);
expect(executable.isFactory, isTrue);
expect(executable.redirectedConstructorName, isEmpty);
- checkTypeRef(executable.redirectedConstructor, null, null, 'named',
+ checkTypeRef(executable.redirectedConstructor, null, 'named',
expectedKind: ReferenceKind.constructor,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.classOrEnum, 'D')
@@ -4104,7 +4085,7 @@ class D<T, U> extends C<U, T> {
expect(executable.isRedirectedConstructor, isTrue);
expect(executable.isFactory, isTrue);
expect(executable.redirectedConstructorName, isEmpty);
- checkTypeRef(executable.redirectedConstructor, null, null, 'named',
+ checkTypeRef(executable.redirectedConstructor, null, 'named',
expectedKind: ReferenceKind.constructor,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.classOrEnum, 'D',
@@ -4136,11 +4117,14 @@ class C {
expect(executable.isRedirectedConstructor, isTrue);
expect(executable.isFactory, isTrue);
expect(executable.redirectedConstructorName, isEmpty);
- checkTypeRef(executable.redirectedConstructor, null, null, 'named',
+ checkTypeRef(executable.redirectedConstructor, null, 'named',
expectedKind: ReferenceKind.constructor,
prefixExpectations: [
- new _PrefixExpectation(ReferenceKind.classOrEnum, 'D',
- absoluteUri: absUri('/foo.dart'), relativeUri: 'foo.dart')
+ new _PrefixExpectation(
+ ReferenceKind.classOrEnum,
+ 'D',
+ absoluteUri: absUri('/foo.dart'),
+ )
]);
}
@@ -4165,13 +4149,15 @@ class C<T, U> {
expect(executable.isRedirectedConstructor, isTrue);
expect(executable.isFactory, isTrue);
expect(executable.redirectedConstructorName, isEmpty);
- checkTypeRef(executable.redirectedConstructor, null, null, 'named',
+ checkTypeRef(executable.redirectedConstructor, null, 'named',
expectedKind: ReferenceKind.constructor,
prefixExpectations: [
- new _PrefixExpectation(ReferenceKind.classOrEnum, 'D',
- numTypeParameters: 2,
- absoluteUri: absUri('/foo.dart'),
- relativeUri: 'foo.dart')
+ new _PrefixExpectation(
+ ReferenceKind.classOrEnum,
+ 'D',
+ numTypeParameters: 2,
+ absoluteUri: absUri('/foo.dart'),
+ )
],
numTypeArguments: 2);
checkParamTypeRef(executable.redirectedConstructor.typeArguments[0], 1);
@@ -4199,11 +4185,14 @@ class C {
expect(executable.isRedirectedConstructor, isTrue);
expect(executable.isFactory, isTrue);
expect(executable.redirectedConstructorName, isEmpty);
- checkTypeRef(executable.redirectedConstructor, null, null, 'named',
+ checkTypeRef(executable.redirectedConstructor, null, 'named',
expectedKind: ReferenceKind.constructor,
prefixExpectations: [
- new _PrefixExpectation(ReferenceKind.classOrEnum, 'D',
- absoluteUri: absUri('/foo.dart'), relativeUri: 'foo.dart'),
+ new _PrefixExpectation(
+ ReferenceKind.classOrEnum,
+ 'D',
+ absoluteUri: absUri('/foo.dart'),
+ ),
new _PrefixExpectation(ReferenceKind.prefix, 'foo')
]);
}
@@ -4229,13 +4218,15 @@ class C<T, U> {
expect(executable.isRedirectedConstructor, isTrue);
expect(executable.isFactory, isTrue);
expect(executable.redirectedConstructorName, isEmpty);
- checkTypeRef(executable.redirectedConstructor, null, null, 'named',
+ checkTypeRef(executable.redirectedConstructor, null, 'named',
expectedKind: ReferenceKind.constructor,
prefixExpectations: [
- new _PrefixExpectation(ReferenceKind.classOrEnum, 'D',
- numTypeParameters: 2,
- absoluteUri: absUri('/foo.dart'),
- relativeUri: 'foo.dart'),
+ new _PrefixExpectation(
+ ReferenceKind.classOrEnum,
+ 'D',
+ numTypeParameters: 2,
+ absoluteUri: absUri('/foo.dart'),
+ ),
new _PrefixExpectation(ReferenceKind.prefix, 'foo')
],
numTypeArguments: 2);
@@ -4258,7 +4249,7 @@ class D extends C {
expect(executable.isRedirectedConstructor, isTrue);
expect(executable.isFactory, isTrue);
expect(executable.redirectedConstructorName, isEmpty);
- checkTypeRef(executable.redirectedConstructor, null, null, 'D');
+ checkTypeRef(executable.redirectedConstructor, null, 'D');
}
test_constructor_redirected_factory_unnamed_generic() {
@@ -4276,7 +4267,7 @@ class D<T, U> extends C<U, T> {
expect(executable.isRedirectedConstructor, isTrue);
expect(executable.isFactory, isTrue);
expect(executable.redirectedConstructorName, isEmpty);
- checkTypeRef(executable.redirectedConstructor, null, null, 'D',
+ checkTypeRef(executable.redirectedConstructor, null, 'D',
numTypeParameters: 2, numTypeArguments: 2);
checkParamTypeRef(executable.redirectedConstructor.typeArguments[0], 1);
checkParamTypeRef(executable.redirectedConstructor.typeArguments[1], 2);
@@ -4303,8 +4294,7 @@ class C {
expect(executable.isRedirectedConstructor, isTrue);
expect(executable.isFactory, isTrue);
expect(executable.redirectedConstructorName, isEmpty);
- checkTypeRef(
- executable.redirectedConstructor, absUri('/foo.dart'), 'foo.dart', 'D');
+ checkTypeRef(executable.redirectedConstructor, absUri('/foo.dart'), 'D');
}
test_constructor_redirected_factory_unnamed_imported_generic() {
@@ -4328,8 +4318,7 @@ class C<T, U> {
expect(executable.isRedirectedConstructor, isTrue);
expect(executable.isFactory, isTrue);
expect(executable.redirectedConstructorName, isEmpty);
- checkTypeRef(
- executable.redirectedConstructor, absUri('/foo.dart'), 'foo.dart', 'D',
+ checkTypeRef(executable.redirectedConstructor, absUri('/foo.dart'), 'D',
numTypeParameters: 2, numTypeArguments: 2);
checkParamTypeRef(executable.redirectedConstructor.typeArguments[0], 1);
checkParamTypeRef(executable.redirectedConstructor.typeArguments[1], 2);
@@ -4356,8 +4345,7 @@ class C {
expect(executable.isRedirectedConstructor, isTrue);
expect(executable.isFactory, isTrue);
expect(executable.redirectedConstructorName, isEmpty);
- checkTypeRef(
- executable.redirectedConstructor, absUri('/foo.dart'), 'foo.dart', 'D',
+ checkTypeRef(executable.redirectedConstructor, absUri('/foo.dart'), 'D',
expectedPrefix: 'foo');
}
@@ -4382,8 +4370,7 @@ class C<T, U> {
expect(executable.isRedirectedConstructor, isTrue);
expect(executable.isFactory, isTrue);
expect(executable.redirectedConstructorName, isEmpty);
- checkTypeRef(
- executable.redirectedConstructor, absUri('/foo.dart'), 'foo.dart', 'D',
+ checkTypeRef(executable.redirectedConstructor, absUri('/foo.dart'), 'D',
numTypeParameters: 2, expectedPrefix: 'foo', numTypeArguments: 2);
checkParamTypeRef(executable.redirectedConstructor.typeArguments[0], 1);
checkParamTypeRef(executable.redirectedConstructor.typeArguments[1], 2);
@@ -4984,7 +4971,7 @@ class C {
// re-export any names defined in b.dart, because a change to b.dart might
// cause it to start exporting a name that the main test library *does*
// use.
- checkHasDependency('b.dart');
+ checkHasDependency(absUri('/b.dart'));
}
test_dependencies_export_unused() {
@@ -4994,17 +4981,17 @@ class C {
// re-export any names defined in a.dart, because a change to a.dart might
// cause it to start exporting a name that the main test library *will*
// re-export.
- checkHasDependency('a.dart');
+ checkHasDependency(absUri('/a.dart'));
}
test_dependencies_import_to_export() {
addNamedSource('/a.dart', 'library a; export "b.dart"; class A {}');
addNamedSource('/b.dart', 'library b;');
serializeLibraryText('import "a.dart"; A a;');
- checkHasDependency('a.dart');
+ checkHasDependency(absUri('/a.dart'));
// The main test library depends on b.dart, because names defined in
// b.dart are exported by a.dart.
- checkHasDependency('b.dart');
+ checkHasDependency(absUri('/b.dart'));
}
test_dependencies_import_to_export_in_subdirs_absolute_export() {
@@ -5012,7 +4999,7 @@ class C {
'library a; export "${absUri('/a/b/b.dart')}"; class A {}');
addNamedSource('/a/b/b.dart', 'library b;');
serializeLibraryText('import "a/a.dart"; A a;');
- checkHasDependency('a/a.dart');
+ checkHasDependency(absUri('/a/a.dart'));
// The main test library depends on b.dart, because names defined in
// b.dart are exported by a.dart.
checkHasDependency(absUri('/a/b/b.dart'));
@@ -5032,20 +5019,20 @@ class C {
addNamedSource('/a/a.dart', 'library a; export "b/b.dart"; class A {}');
addNamedSource('/a/b/b.dart', 'library b;');
serializeLibraryText('import "a/a.dart"; A a;');
- checkHasDependency('a/a.dart');
+ checkHasDependency(absUri('/a/a.dart'));
// The main test library depends on b.dart, because names defined in
// b.dart are exported by a.dart.
- checkHasDependency('a/b/b.dart');
+ checkHasDependency(absUri('/a/b/b.dart'));
}
test_dependencies_import_to_export_loop() {
addNamedSource('/a.dart', 'library a; export "b.dart"; class A {}');
addNamedSource('/b.dart', 'library b; export "a.dart";');
serializeLibraryText('import "a.dart"; A a;');
- checkHasDependency('a.dart');
+ checkHasDependency(absUri('/a.dart'));
// Serialization should have been able to walk the transitive export
// dependencies to b.dart without going into an infinite loop.
- checkHasDependency('b.dart');
+ checkHasDependency(absUri('/b.dart'));
}
test_dependencies_import_to_export_transitive_closure() {
@@ -5053,10 +5040,10 @@ class C {
addNamedSource('/b.dart', 'library b; export "c.dart";');
addNamedSource('/c.dart', 'library c;');
serializeLibraryText('import "a.dart"; A a;');
- checkHasDependency('a.dart');
+ checkHasDependency(absUri('/a.dart'));
// The main test library depends on c.dart, because names defined in
// c.dart are exported by b.dart and then re-exported by a.dart.
- checkHasDependency('c.dart');
+ checkHasDependency(absUri('/c.dart'));
}
test_dependencies_import_to_export_unused() {
@@ -5066,7 +5053,7 @@ class C {
// The main test library depends on b.dart, even though it doesn't use any
// names defined in b.dart, because a change to b.dart might cause it to
// start exporting a name that the main test library *does* use.
- checkHasDependency('b.dart');
+ checkHasDependency(absUri('/b.dart'));
}
test_dependencies_import_transitive_closure() {
@@ -5074,10 +5061,10 @@ class C {
'/a.dart', 'library a; import "b.dart"; class A extends B {}');
addNamedSource('/b.dart', 'library b; class B {}');
serializeLibraryText('import "a.dart"; A a;');
- checkHasDependency('a.dart');
+ checkHasDependency(absUri('/a.dart'));
// The main test library doesn't depend on b.dart, because no change to
// b.dart can possibly affect the serialized element model for it.
- checkLacksDependency('b.dart');
+ checkLacksDependency(absUri('/b.dart'));
}
test_dependencies_import_unused() {
@@ -5086,7 +5073,7 @@ class C {
// The main test library depends on a.dart, even though it doesn't use any
// names defined in a.dart, because a change to a.dart might cause it to
// start exporting a name that the main test library *does* use.
- checkHasDependency('a.dart');
+ checkHasDependency(absUri('/a.dart'));
}
test_dependencies_parts() {
@@ -5095,8 +5082,9 @@ class C {
addNamedSource('/b.dart', 'part of a;');
addNamedSource('/c.dart', 'part of a;');
serializeLibraryText('import "a.dart"; A a;');
- int dep = checkHasDependency('a.dart');
- checkDependencyParts(linked.dependencies[dep], ['b.dart', 'c.dart']);
+ int dep = checkHasDependency(absUri('/a.dart'));
+ checkDependencyParts(
+ linked.dependencies[dep], [absUri('/b.dart'), absUri('/c.dart')]);
}
test_dependencies_parts_relative_to_importing_library() {
@@ -5106,9 +5094,9 @@ class C {
addNamedSource('/a/c/e/f.dart', 'part of d;');
addNamedSource('/a/c/g/h.dart', 'part of d;');
serializeLibraryText('import "a/b.dart"; D d;');
- int dep = checkHasDependency('a/c/d.dart');
- checkDependencyParts(
- linked.dependencies[dep], ['a/c/e/f.dart', 'a/c/g/h.dart']);
+ int dep = checkHasDependency(absUri('/a/c/d.dart'));
+ checkDependencyParts(linked.dependencies[dep],
+ [absUri('/a/c/e/f.dart'), absUri('/a/c/g/h.dart')]);
}
test_elements_in_part() {
@@ -5309,7 +5297,7 @@ Stream f() async* {}
test_executable_getter_type() {
UnlinkedExecutable executable = serializeExecutableText('int get f => 1;');
- checkTypeRef(executable.returnType, 'dart:core', 'dart:core', 'int');
+ checkTypeRef(executable.returnType, 'dart:core', 'int');
expect(executable.parameters, isEmpty);
}
@@ -5410,7 +5398,7 @@ var v = (
{
UnlinkedVariable e = variables.singleWhere((v) => v.name == 'e');
_assertVariableVisible(code, e, 'on int catch (', '} // 3');
- checkTypeRef(e.type, 'dart:core', 'dart:core', 'int');
+ checkTypeRef(e.type, 'dart:core', 'int');
}
{
UnlinkedVariable st = variables.singleWhere((v) => v.name == 'st');
@@ -5458,7 +5446,7 @@ var v = (() {
{
UnlinkedVariable i = variables.singleWhere((v) => v.name == 'i');
_assertVariableVisible(code, i, 'for', '} // 3');
- checkTypeRef(i.type, 'dart:core', 'dart:core', 'int');
+ checkTypeRef(i.type, 'dart:core', 'int');
}
}
@@ -5482,7 +5470,7 @@ var v = (() {
{
UnlinkedVariable i = variables.singleWhere((v) => v.name == 'i');
_assertVariableVisible(code, i, '{ // 1', '} // 4');
- checkTypeRef(i.type, 'dart:core', 'dart:core', 'int');
+ checkTypeRef(i.type, 'dart:core', 'int');
}
}
@@ -5505,12 +5493,12 @@ var v = (() {
{
UnlinkedVariable i = variables.singleWhere((v) => v.name == 'i');
_assertVariableVisible(code, i, 'for', '} // 3');
- checkTypeRef(i.type, 'dart:core', 'dart:core', 'int');
+ checkTypeRef(i.type, 'dart:core', 'int');
}
{
UnlinkedVariable i = variables.singleWhere((v) => v.name == 'j');
_assertVariableVisible(code, i, 'for', '} // 3');
- checkTypeRef(i.type, 'dart:core', 'dart:core', 'int');
+ checkTypeRef(i.type, 'dart:core', 'int');
}
}
@@ -5574,7 +5562,7 @@ var v = (() {
// f1 - v1
UnlinkedVariable v1 = variables.singleWhere((v) => v.name == 'v1');
_assertVariableVisible(code, v1, '{ // 1', '} // 2');
- checkTypeRef(v1.type, 'dart:core', 'dart:core', 'int');
+ checkTypeRef(v1.type, 'dart:core', 'int');
}
// f - f2
{
@@ -5586,7 +5574,7 @@ var v = (() {
// f - f2 - v1
UnlinkedVariable v1 = variables2.singleWhere((v) => v.name == 'v1');
_assertVariableVisible(code, v1, '{ // 3', '} // 6');
- checkTypeRef(v1.type, 'dart:core', 'dart:core', 'int');
+ checkTypeRef(v1.type, 'dart:core', 'int');
// f - f2 - f3
UnlinkedExecutable f3 = functions2.singleWhere((v) => v.name == 'f3');
_assertExecutableVisible(code, f3, '{ // 3', '} // 6');
@@ -5597,7 +5585,7 @@ var v = (() {
// f - f3 - v2
UnlinkedVariable v2 = variables3.singleWhere((v) => v.name == 'v2');
_assertVariableVisible(code, v2, '{ // 4', '} // 5');
- checkTypeRef(v2.type, 'dart:core', 'dart:core', 'int');
+ checkTypeRef(v2.type, 'dart:core', 'int');
}
}
@@ -5813,7 +5801,7 @@ class C {
expect(executable.isGenerator, isFalse);
expect(executable.isStatic, false);
expect(executable.parameters, hasLength(1));
- checkTypeRef(executable.returnType, null, null, 'C');
+ checkTypeRef(executable.returnType, null, 'C');
expect(executable.typeParameters, isEmpty);
expect(executable.isExternal, false);
}
@@ -5864,7 +5852,7 @@ class C {
expect(executable.isFactory, false);
expect(executable.isStatic, false);
expect(executable.parameters, hasLength(1));
- checkTypeRef(executable.returnType, 'dart:core', 'dart:core', 'bool');
+ checkTypeRef(executable.returnType, 'dart:core', 'bool');
expect(executable.typeParameters, isEmpty);
}
@@ -5929,8 +5917,7 @@ class C {
test_executable_param_function_typed_return_type() {
UnlinkedExecutable executable = serializeExecutableText('f(int g()) {}');
- checkTypeRef(
- executable.parameters[0].type, 'dart:core', 'dart:core', 'int');
+ checkTypeRef(executable.parameters[0].type, 'dart:core', 'int');
}
test_executable_param_function_typed_return_type_implicit() {
@@ -5956,7 +5943,7 @@ int foo(int a, String b) => 0;
assertUnlinkedConst(param.initializer.bodyExpr, operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'foo',
+ (EntityRef r) => checkTypeRef(r, null, 'foo',
expectedKind: ReferenceKind.topLevelFunction)
]);
}
@@ -6105,13 +6092,13 @@ typedef MyFunction(int p);
f(MyFunction myFunction) {}
''');
expect(executable.parameters[0].isFunctionTyped, isFalse);
- checkTypeRef(executable.parameters[0].type, null, null, 'MyFunction',
+ checkTypeRef(executable.parameters[0].type, null, 'MyFunction',
expectedKind: ReferenceKind.typedef);
}
test_executable_return_type() {
UnlinkedExecutable executable = serializeExecutableText('int f() => 1;');
- checkTypeRef(executable.returnType, 'dart:core', 'dart:core', 'int');
+ checkTypeRef(executable.returnType, 'dart:core', 'int');
}
test_executable_return_type_implicit() {
@@ -6169,8 +6156,7 @@ f(MyFunction myFunction) {}
checkVoidTypeRef(executable.returnType);
expect(executable.parameters, hasLength(1));
expect(executable.parameters[0].name, 'value');
- checkTypeRef(
- executable.parameters[0].type, 'dart:core', 'dart:core', 'int');
+ checkTypeRef(executable.parameters[0].type, 'dart:core', 'int');
}
test_executable_static() {
@@ -6232,7 +6218,7 @@ f(MyFunction myFunction) {}
addNamedSource('/a.dart', 'class C {}');
serializeLibraryText('export "a.dart";');
expect(linked.exportNames, hasLength(1));
- checkExportName(linked.exportNames[0], absUri('/a.dart'), 'a.dart', 'C',
+ checkExportName(linked.exportNames[0], absUri('/a.dart'), 'C',
ReferenceKind.classOrEnum);
}
@@ -6241,7 +6227,7 @@ f(MyFunction myFunction) {}
'/a.dart', 'class C extends _D with _E {} class _D {} class _E {}');
serializeLibraryText('export "a.dart";');
expect(linked.exportNames, hasLength(1));
- checkExportName(linked.exportNames[0], absUri('/a.dart'), 'a.dart', 'C',
+ checkExportName(linked.exportNames[0], absUri('/a.dart'), 'C',
ReferenceKind.classOrEnum);
}
@@ -6276,14 +6262,14 @@ class B extends A {}
test_export_dependency() {
serializeLibraryText('export "dart:async";');
expect(unlinkedUnits[0].exports, hasLength(1));
- checkDependency(linked.exportDependencies[0], 'dart:async', 'dart:async');
+ checkDependency(linked.exportDependencies[0], 'dart:async');
}
test_export_enum() {
addNamedSource('/a.dart', 'enum E { v }');
serializeLibraryText('export "a.dart";');
expect(linked.exportNames, hasLength(1));
- checkExportName(linked.exportNames[0], absUri('/a.dart'), 'a.dart', 'E',
+ checkExportName(linked.exportNames[0], absUri('/a.dart'), 'E',
ReferenceKind.classOrEnum);
}
@@ -6292,7 +6278,7 @@ class B extends A {}
addNamedSource('/b.dart', 'part of foo; f() {}');
serializeLibraryText('export "a.dart";');
expect(linked.exportNames, hasLength(1));
- checkExportName(linked.exportNames[0], absUri('/a.dart'), 'a.dart', 'f',
+ checkExportName(linked.exportNames[0], absUri('/a.dart'), 'f',
ReferenceKind.topLevelFunction,
expectedTargetUnit: 1);
}
@@ -6301,7 +6287,7 @@ class B extends A {}
addNamedSource('/a.dart', 'f() {}');
serializeLibraryText('export "a.dart";');
expect(linked.exportNames, hasLength(1));
- checkExportName(linked.exportNames[0], absUri('/a.dart'), 'a.dart', 'f',
+ checkExportName(linked.exportNames[0], absUri('/a.dart'), 'f',
ReferenceKind.topLevelFunction);
}
@@ -6309,7 +6295,7 @@ class B extends A {}
addNamedSource('/a.dart', 'get f => null');
serializeLibraryText('export "a.dart";');
expect(linked.exportNames, hasLength(1));
- checkExportName(linked.exportNames[0], absUri('/a.dart'), 'a.dart', 'f',
+ checkExportName(linked.exportNames[0], absUri('/a.dart'), 'f',
ReferenceKind.topLevelPropertyAccessor);
}
@@ -6317,7 +6303,7 @@ class B extends A {}
addNamedSource('/a.dart', 'f() {} g() {}');
serializeLibraryText('export "a.dart" hide g;');
expect(linked.exportNames, hasLength(1));
- checkExportName(linked.exportNames[0], absUri('/a.dart'), 'a.dart', 'f',
+ checkExportName(linked.exportNames[0], absUri('/a.dart'), 'f',
ReferenceKind.topLevelFunction);
}
@@ -6348,8 +6334,7 @@ class B extends A {}
allowMissingFiles = true;
serializeLibraryText('export "foo.dart";', allowErrors: true);
expect(unlinkedUnits[0].imports, hasLength(1));
- checkDependency(
- linked.exportDependencies[0], absUri('/foo.dart'), 'foo.dart');
+ checkDependency(linked.exportDependencies[0], absUri('/foo.dart'));
}
test_export_names_excludes_names_from_library() {
@@ -6368,7 +6353,7 @@ class B extends A {}
addNamedSource('/a.dart', 'f() {}');
serializeLibraryText('export "a.dart"; import "dart:core" as f; f.int _x;');
expect(linked.exportNames, hasLength(1));
- checkExportName(linked.exportNames[0], absUri('/a.dart'), 'a.dart', 'f',
+ checkExportName(linked.exportNames[0], absUri('/a.dart'), 'f',
ReferenceKind.topLevelFunction);
}
@@ -6392,7 +6377,7 @@ class B extends A {}
addNamedSource('/a.dart', 'void set f(value) {}');
serializeLibraryText('export "a.dart";');
expect(linked.exportNames, hasLength(1));
- checkExportName(linked.exportNames[0], absUri('/a.dart'), 'a.dart', 'f=',
+ checkExportName(linked.exportNames[0], absUri('/a.dart'), 'f=',
ReferenceKind.topLevelPropertyAccessor);
}
@@ -6418,7 +6403,7 @@ class B extends A {}
addNamedSource('/a.dart', 'var v;');
serializeLibraryText('export "a.dart"; const v = 0;');
expect(linked.exportNames, hasLength(1));
- checkExportName(linked.exportNames[0], absUri('/a.dart'), 'a.dart', 'v=',
+ checkExportName(linked.exportNames[0], absUri('/a.dart'), 'v=',
ReferenceKind.topLevelPropertyAccessor);
}
@@ -6428,7 +6413,7 @@ class B extends A {}
addNamedSource('/a.dart', 'var v;');
serializeLibraryText('export "a.dart"; final v = 0;');
expect(linked.exportNames, hasLength(1));
- checkExportName(linked.exportNames[0], absUri('/a.dart'), 'a.dart', 'v=',
+ checkExportName(linked.exportNames[0], absUri('/a.dart'), 'v=',
ReferenceKind.topLevelPropertyAccessor);
}
@@ -6436,7 +6421,7 @@ class B extends A {}
addNamedSource('/a.dart', 'f() {} g() {}');
serializeLibraryText('export "a.dart" show f;');
expect(linked.exportNames, hasLength(1));
- checkExportName(linked.exportNames[0], absUri('/a.dart'), 'a.dart', 'f',
+ checkExportName(linked.exportNames[0], absUri('/a.dart'), 'f',
ReferenceKind.topLevelFunction);
}
@@ -6466,8 +6451,8 @@ class B extends A {}
addNamedSource('/a.dart', 'typedef F();');
serializeLibraryText('export "a.dart";');
expect(linked.exportNames, hasLength(1));
- checkExportName(linked.exportNames[0], absUri('/a.dart'), 'a.dart', 'F',
- ReferenceKind.typedef);
+ checkExportName(
+ linked.exportNames[0], absUri('/a.dart'), 'F', ReferenceKind.typedef);
}
test_export_uri() {
@@ -6507,12 +6492,12 @@ export "${'a'}.dart";
LinkedExportName getter =
linked.exportNames.firstWhere((e) => e.name == 'v');
expect(getter, isNotNull);
- checkExportName(getter, absUri('/a.dart'), 'a.dart', 'v',
- ReferenceKind.topLevelPropertyAccessor);
+ checkExportName(
+ getter, absUri('/a.dart'), 'v', ReferenceKind.topLevelPropertyAccessor);
LinkedExportName setter =
linked.exportNames.firstWhere((e) => e.name == 'v=');
expect(setter, isNotNull);
- checkExportName(setter, absUri('/a.dart'), 'a.dart', 'v=',
+ checkExportName(setter, absUri('/a.dart'), 'v=',
ReferenceKind.topLevelPropertyAccessor);
}
@@ -6615,7 +6600,7 @@ final v = (a.b.c.f[1] = 5);
],
strings: [],
referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'f',
+ (EntityRef r) => checkTypeRef(r, null, 'f',
expectedKind: ReferenceKind.unresolved,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.unresolved, 'c'),
@@ -6675,7 +6660,7 @@ final v = (a.b[1].c[2].f[3] = 5);
'f'
],
referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'b',
+ (EntityRef r) => checkTypeRef(r, null, 'b',
expectedKind: ReferenceKind.unresolved,
prefixExpectations: [
new _PrefixExpectation(
@@ -6709,7 +6694,7 @@ final v = (a[1] = 5);
],
strings: [],
referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'a',
+ (EntityRef r) => checkTypeRef(r, null, 'a',
expectedKind: ReferenceKind.topLevelPropertyAccessor)
]);
}
@@ -6743,7 +6728,7 @@ final v = (new C().f = 5);
'f'
],
referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'C',
+ (EntityRef r) => checkTypeRef(r, null, 'C',
expectedKind: ReferenceKind.classOrEnum)
]);
}
@@ -6772,7 +6757,7 @@ final v = (C.f = 1);
],
strings: [],
referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'f',
+ (EntityRef r) => checkTypeRef(r, null, 'f',
expectedKind: ReferenceKind.unresolved,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.classOrEnum, 'C')
@@ -6811,7 +6796,7 @@ final v = (a.b.c.f = 1);
],
strings: [],
referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'f',
+ (EntityRef r) => checkTypeRef(r, null, 'f',
expectedKind: ReferenceKind.unresolved,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.unresolved, 'c'),
@@ -6864,7 +6849,7 @@ final v = (a = 1);
],
strings: [],
referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'a',
+ (EntityRef r) => checkTypeRef(r, null, 'a',
expectedKind: ReferenceKind.topLevelPropertyAccessor)
]);
}
@@ -6896,7 +6881,7 @@ final v = (a = 1);
],
strings: [],
referenceValidators: [
- (EntityRef r) => checkTypeRef(r, absUri('/a.dart'), 'a.dart', 'a',
+ (EntityRef r) => checkTypeRef(r, absUri('/a.dart'), 'a',
expectedKind: ReferenceKind.topLevelPropertyAccessor)
]);
}
@@ -6929,7 +6914,7 @@ final v = (p.a = 1);
strings: [],
referenceValidators: [
(EntityRef r) {
- return checkTypeRef(r, absUri('/a.dart'), 'a.dart', 'a',
+ return checkTypeRef(r, absUri('/a.dart'), 'a',
expectedKind: ReferenceKind.topLevelPropertyAccessor,
expectedPrefix: 'p');
}
@@ -6968,7 +6953,7 @@ final v = c.items..[1] = 2;
],
strings: [],
referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'items',
+ (EntityRef r) => checkTypeRef(r, null, 'items',
expectedKind: ReferenceKind.unresolved,
prefixExpectations: [
new _PrefixExpectation(
@@ -7020,7 +7005,7 @@ final v = new C()..f1 = 1..f2 += 2;
'f2',
],
referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'C',
+ (EntityRef r) => checkTypeRef(r, null, 'C',
expectedKind: ReferenceKind.classOrEnum)
]);
}
@@ -7093,9 +7078,9 @@ final v = new A()
'fa2',
],
referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'A',
+ (EntityRef r) => checkTypeRef(r, null, 'A',
expectedKind: ReferenceKind.classOrEnum),
- (EntityRef r) => checkTypeRef(r, null, null, 'B',
+ (EntityRef r) => checkTypeRef(r, null, 'B',
expectedKind: ReferenceKind.classOrEnum),
]);
}
@@ -7142,7 +7127,7 @@ final v = a..m(5).abs()..m(6);
'm',
],
referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'a',
+ (EntityRef r) => checkTypeRef(r, null, 'a',
expectedKind: ReferenceKind.topLevelPropertyAccessor),
]);
}
@@ -7174,7 +7159,7 @@ final v = new C().items[5];
'items'
],
referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'C',
+ (EntityRef r) => checkTypeRef(r, null, 'C',
expectedKind: ReferenceKind.classOrEnum)
]);
}
@@ -7203,7 +7188,7 @@ final v = new C().f;
'f'
],
referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'C',
+ (EntityRef r) => checkTypeRef(r, null, 'C',
expectedKind: ReferenceKind.classOrEnum)
]);
}
@@ -7232,7 +7217,7 @@ foo(a, b) {}
0
],
referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'foo',
+ (EntityRef r) => checkTypeRef(r, null, 'foo',
expectedKind: ReferenceKind.topLevelFunction)
]);
}
@@ -7264,7 +7249,7 @@ foo(a, b, c) {}
0
],
referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'foo',
+ (EntityRef r) => checkTypeRef(r, null, 'foo',
expectedKind: ReferenceKind.topLevelFunction)
]);
}
@@ -7423,7 +7408,7 @@ final v = ((a, b) => 42)(1, 2);
0
],
referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'x',
+ (EntityRef r) => checkTypeRef(r, null, 'x',
expectedKind: ReferenceKind.topLevelPropertyAccessor)
]);
}
@@ -7556,7 +7541,7 @@ final v = new C().m(1, b: 2, c: 3);
'm'
],
referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'C',
+ (EntityRef r) => checkTypeRef(r, null, 'C',
expectedKind: ReferenceKind.classOrEnum)
]);
}
@@ -7588,9 +7573,9 @@ final v = new C().f<int, String>();
'f'
],
referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'C'),
- (EntityRef r) => checkTypeRef(r, 'dart:core', 'dart:core', 'int'),
- (EntityRef r) => checkTypeRef(r, 'dart:core', 'dart:core', 'String')
+ (EntityRef r) => checkTypeRef(r, null, 'C'),
+ (EntityRef r) => checkTypeRef(r, 'dart:core', 'int'),
+ (EntityRef r) => checkTypeRef(r, 'dart:core', 'String')
]);
}
@@ -7627,7 +7612,7 @@ final v = a.b.c.m(10, 20);
],
strings: [],
referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'm',
+ (EntityRef r) => checkTypeRef(r, null, 'm',
expectedKind: ReferenceKind.unresolved,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.unresolved, 'c'),
@@ -7665,11 +7650,11 @@ final v = p.C.m();
],
strings: [],
referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'm',
+ (EntityRef r) => checkTypeRef(r, null, 'm',
expectedKind: ReferenceKind.method,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.classOrEnum, 'C',
- absoluteUri: absUri('/a.dart'), relativeUri: 'a.dart'),
+ absoluteUri: absUri('/a.dart')),
new _PrefixExpectation(ReferenceKind.prefix, 'p')
])
]);
@@ -7696,9 +7681,9 @@ final v = f(u);
0
],
referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'u',
+ (EntityRef r) => checkTypeRef(r, null, 'u',
expectedKind: ReferenceKind.topLevelPropertyAccessor),
- (EntityRef r) => checkTypeRef(r, null, null, 'f',
+ (EntityRef r) => checkTypeRef(r, null, 'f',
expectedKind: ReferenceKind.topLevelFunction)
]);
}
@@ -7722,11 +7707,11 @@ final v = f<int, String>();
2
],
referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'f',
+ (EntityRef r) => checkTypeRef(r, null, 'f',
expectedKind: ReferenceKind.topLevelFunction,
numTypeParameters: 2),
- (EntityRef r) => checkTypeRef(r, 'dart:core', 'dart:core', 'int'),
- (EntityRef r) => checkTypeRef(r, 'dart:core', 'dart:core', 'String')
+ (EntityRef r) => checkTypeRef(r, 'dart:core', 'int'),
+ (EntityRef r) => checkTypeRef(r, 'dart:core', 'String')
]);
}
@@ -7792,7 +7777,7 @@ final v = 42 as num;
42
],
referenceValidators: [
- (EntityRef r) => checkTypeRef(r, 'dart:core', 'dart:core', 'num',
+ (EntityRef r) => checkTypeRef(r, 'dart:core', 'num',
expectedKind: ReferenceKind.classOrEnum)
]);
}
@@ -7814,7 +7799,7 @@ final v = 42 is num;
42
],
referenceValidators: [
- (EntityRef r) => checkTypeRef(r, 'dart:core', 'dart:core', 'num',
+ (EntityRef r) => checkTypeRef(r, 'dart:core', 'num',
expectedKind: ReferenceKind.classOrEnum)
]);
}
@@ -7886,7 +7871,7 @@ class C {
],
strings: [],
referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'm',
+ (EntityRef r) => checkTypeRef(r, null, 'm',
expectedKind: ReferenceKind.method,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.classOrEnum, 'C')
@@ -7911,8 +7896,7 @@ class C<T> {
'class C extends D { var v; C(int this.v); }'
' abstract class D { num get v; }',
className: 'C');
- checkInferredTypeSlot(
- cls.fields[0].inferredTypeSlot, 'dart:core', 'dart:core', 'num');
+ checkInferredTypeSlot(cls.fields[0].inferredTypeSlot, 'dart:core', 'num');
expect(cls.executables[0].kind, UnlinkedExecutableKind.constructor);
expect(cls.executables[0].parameters[0].inferredTypeSlot, 0);
}
@@ -7927,8 +7911,7 @@ class C<T> {
'class C extends D { var v; C(this.v); }'
' abstract class D { int get v; }',
className: 'C');
- checkInferredTypeSlot(
- cls.fields[0].inferredTypeSlot, 'dart:core', 'dart:core', 'int');
+ checkInferredTypeSlot(cls.fields[0].inferredTypeSlot, 'dart:core', 'int');
expect(cls.executables[0].kind, UnlinkedExecutableKind.constructor);
expect(cls.executables[0].parameters[0].inferredTypeSlot, 0);
}
@@ -7949,7 +7932,7 @@ class C<T> {
test_field_inferred_type_nonstatic_implicit_initialized() {
UnlinkedVariable v = serializeClassText('class C { var v = 0; }').fields[0];
- checkInferredTypeSlot(v.inferredTypeSlot, 'dart:core', 'dart:core', 'int');
+ checkInferredTypeSlot(v.inferredTypeSlot, 'dart:core', 'int');
}
test_field_inferred_type_nonstatic_implicit_uninitialized() {
@@ -7957,7 +7940,7 @@ class C<T> {
'class C extends D { var v; } abstract class D { int get v; }',
className: 'C')
.fields[0];
- checkInferredTypeSlot(v.inferredTypeSlot, 'dart:core', 'dart:core', 'int');
+ checkInferredTypeSlot(v.inferredTypeSlot, 'dart:core', 'int');
}
test_field_inferred_type_static_explicit_initialized() {
@@ -7969,7 +7952,7 @@ class C<T> {
test_field_inferred_type_static_implicit_initialized() {
UnlinkedVariable v =
serializeClassText('class C { static var v = 0; }').fields[0];
- checkInferredTypeSlot(v.inferredTypeSlot, 'dart:core', 'dart:core', 'int');
+ checkInferredTypeSlot(v.inferredTypeSlot, 'dart:core', 'int');
}
test_field_inferred_type_static_implicit_uninitialized() {
@@ -8021,10 +8004,9 @@ class C<T> {
return;
}
serializeLibraryText('final x = 0; String y;');
- checkLinkedTypeSlot(unlinkedUnits[0].variables[0].inferredTypeSlot,
- 'dart:core', 'dart:core', 'int');
- checkTypeRef(
- unlinkedUnits[0].variables[1].type, 'dart:core', 'dart:core', 'String');
+ checkLinkedTypeSlot(
+ unlinkedUnits[0].variables[0].inferredTypeSlot, 'dart:core', 'int');
+ checkTypeRef(unlinkedUnits[0].variables[1].type, '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.
@@ -8095,8 +8077,7 @@ get f => null;''';
'class C extends D { get f => null; } abstract class D { int get f; }',
className: 'C')
.executables[0];
- checkInferredTypeSlot(
- f.inferredReturnTypeSlot, 'dart:core', 'dart:core', 'int');
+ checkInferredTypeSlot(f.inferredReturnTypeSlot, 'dart:core', 'int');
}
test_getter_inferred_type_static_implicit_return() {
@@ -8159,7 +8140,7 @@ import 'foo.dart'
serializeLibraryText('import "dart:async"; Future x;');
// Second import is the implicit import of dart:core
expect(unlinkedUnits[0].imports, hasLength(2));
- checkDependency(linked.importDependencies[0], 'dart:async', 'dart:async');
+ checkDependency(linked.importDependencies[0], 'dart:async');
}
test_import_explicit() {
@@ -8188,7 +8169,7 @@ import 'foo.dart'
// The implicit import of dart:core is represented in the model.
serializeLibraryText('');
expect(unlinkedUnits[0].imports, hasLength(1));
- checkDependency(linked.importDependencies[0], 'dart:core', 'dart:core');
+ checkDependency(linked.importDependencies[0], 'dart:core');
expect(unlinkedUnits[0].imports[0].uri, isEmpty);
if (includeInformative) {
expect(unlinkedUnits[0].imports[0].uriOffset, 0);
@@ -8206,8 +8187,7 @@ import 'foo.dart'
serializeLibraryText('import "foo.dart";', allowErrors: true);
// Second import is the implicit import of dart:core
expect(unlinkedUnits[0].imports, hasLength(2));
- checkDependency(
- linked.importDependencies[0], absUri('/foo.dart'), 'foo.dart');
+ checkDependency(linked.importDependencies[0], absUri('/foo.dart'));
}
test_import_no_combinators() {
@@ -8235,7 +8215,7 @@ import 'foo.dart'
allowMissingFiles = true;
addNamedSource('/foo.dart', 'part "bar.dart"; class C {}');
serializeLibraryText('import "foo.dart"; C x;');
- checkTypeRef(findVariable('x').type, absUri('/foo.dart'), 'foo.dart', 'C');
+ checkTypeRef(findVariable('x').type, absUri('/foo.dart'), 'C');
}
test_import_of_missing_export() {
@@ -8244,7 +8224,7 @@ import 'foo.dart'
allowMissingFiles = true;
addNamedSource('/foo.dart', 'export "bar.dart"; class C {}');
serializeLibraryText('import "foo.dart"; C x;');
- checkTypeRef(findVariable('x').type, absUri('/foo.dart'), 'foo.dart', 'C');
+ checkTypeRef(findVariable('x').type, absUri('/foo.dart'), 'C');
}
test_import_offset() {
@@ -8282,7 +8262,7 @@ import 'foo.dart'
test_import_prefix_reference() {
UnlinkedVariable variable =
serializeVariableText('import "dart:async" as a; a.Future v;');
- checkTypeRef(variable.type, 'dart:async', 'dart:async', 'Future',
+ checkTypeRef(variable.type, 'dart:async', 'Future',
expectedPrefix: 'a', numTypeParameters: 1);
}
@@ -8301,19 +8281,18 @@ b.Cls bCls;
c.Cls cCls;
D dCls;
''');
- checkTypeRef(findVariable('aCls').type, absUri('/a.dart'), 'a.dart', 'A');
- checkTypeRef(findVariable('bCls').type, absUri('/b.dart'), 'b.dart', 'Cls',
+ checkTypeRef(findVariable('aCls').type, absUri('/a.dart'), 'A');
+ checkTypeRef(findVariable('bCls').type, absUri('/b.dart'), 'Cls',
expectedPrefix: 'b');
- checkTypeRef(findVariable('cCls').type, absUri('/c.dart'), 'c.dart', 'Cls',
+ checkTypeRef(findVariable('cCls').type, absUri('/c.dart'), 'Cls',
expectedPrefix: 'c');
- checkTypeRef(findVariable('dCls').type, absUri('/d.dart'), 'd.dart', 'D');
+ checkTypeRef(findVariable('dCls').type, absUri('/d.dart'), 'D');
}
test_import_reference() {
UnlinkedVariable variable =
serializeVariableText('import "dart:async"; Future v;');
- checkTypeRef(variable.type, 'dart:async', 'dart:async', 'Future',
- numTypeParameters: 1);
+ checkTypeRef(variable.type, 'dart:async', 'Future', numTypeParameters: 1);
}
test_import_reference_merged_no_prefix() {
@@ -8326,12 +8305,11 @@ Stream s;
''');
{
EntityRef typeRef = findVariable('f').type;
- checkTypeRef(typeRef, 'dart:async', 'dart:async', 'Future',
- numTypeParameters: 1);
+ checkTypeRef(typeRef, 'dart:async', 'Future', numTypeParameters: 1);
}
{
EntityRef typeRef = findVariable('s').type;
- checkTypeRef(typeRef, 'dart:async', 'dart:async', 'Stream',
+ checkTypeRef(typeRef, 'dart:async', 'Stream',
expectedTargetUnit: 1, numTypeParameters: 1);
}
}
@@ -8346,12 +8324,12 @@ a.Stream s;
''');
{
EntityRef typeRef = findVariable('f').type;
- checkTypeRef(typeRef, 'dart:async', 'dart:async', 'Future',
+ checkTypeRef(typeRef, 'dart:async', 'Future',
expectedPrefix: 'a', numTypeParameters: 1);
}
{
EntityRef typeRef = findVariable('s').type;
- checkTypeRef(typeRef, 'dart:async', 'dart:async', 'Stream',
+ checkTypeRef(typeRef, 'dart:async', 'Stream',
expectedTargetUnit: 1, expectedPrefix: 'a', numTypeParameters: 1);
}
}
@@ -8366,9 +8344,9 @@ import 'b.dart' as p;
p.A a;
p.B b;
''');
- checkTypeRef(findVariable('a').type, absUri('/a.dart'), 'a.dart', 'A',
+ checkTypeRef(findVariable('a').type, absUri('/a.dart'), 'A',
expectedPrefix: 'p');
- checkTypeRef(findVariable('b').type, absUri('/b.dart'), 'b.dart', 'B',
+ checkTypeRef(findVariable('b').type, absUri('/b.dart'), 'B',
expectedPrefix: 'p');
}
@@ -8379,10 +8357,9 @@ class C {}
class D extends p.C {} // Prevent "unused import" warning
''');
expect(unlinkedUnits[0].imports[0].uri, 'test.dart');
- checkDependency(
- linked.importDependencies[0], absUri('/test.dart'), 'test.dart');
- checkTypeRef(unlinkedUnits[0].classes[1].supertype, absUri('/test.dart'),
- 'test.dart', 'C',
+ checkDependency(linked.importDependencies[0], absUri('/test.dart'));
+ checkTypeRef(
+ unlinkedUnits[0].classes[1].supertype, absUri('/test.dart'), 'C',
expectedPrefix: 'p');
}
@@ -8453,7 +8430,7 @@ class C<T> extends B<T> {
UnlinkedParam g = f.parameters[0];
expect(g.name, 'g');
EntityRef typeRef = getTypeRefForSlot(g.inferredTypeSlot);
- checkLinkedTypeRef(typeRef, null, null, 'f',
+ checkLinkedTypeRef(typeRef, null, 'f',
expectedKind: ReferenceKind.method, numTypeArguments: 1);
checkParamTypeRef(typeRef.typeArguments[0], 1);
}
@@ -8466,10 +8443,10 @@ class C<T> extends B<T> {
serializeClassText('class C { final x = <dynamic, int>{}; }');
EntityRef type = getTypeRefForSlot(cls.fields[0].inferredTypeSlot);
// Check that x has inferred type `Map<dynamic, int>`.
- checkLinkedTypeRef(type, 'dart:core', 'dart:core', 'Map',
+ checkLinkedTypeRef(type, 'dart:core', 'Map',
numTypeParameters: 2, numTypeArguments: 2);
- checkLinkedTypeRef(type.typeArguments[0], null, null, 'dynamic');
- checkLinkedTypeRef(type.typeArguments[1], 'dart:core', 'dart:core', 'int');
+ checkLinkedTypeRef(type.typeArguments[0], null, 'dynamic');
+ checkLinkedTypeRef(type.typeArguments[1], 'dart:core', 'int');
}
test_inferred_type_reference_shared_prefixed() {
@@ -8495,10 +8472,10 @@ class C<T> extends B<T> {
className: 'C');
EntityRef type = getTypeRefForSlot(cls.fields[0].inferredTypeSlot);
// Check that v has inferred type Map<T, int>.
- checkLinkedTypeRef(type, 'dart:core', 'dart:core', 'Map',
+ checkLinkedTypeRef(type, 'dart:core', 'Map',
numTypeParameters: 2, numTypeArguments: 2);
checkParamTypeRef(type.typeArguments[0], 1);
- checkLinkedTypeRef(type.typeArguments[1], 'dart:core', 'dart:core', 'int');
+ checkLinkedTypeRef(type.typeArguments[1], 'dart:core', 'int');
}
test_inferred_type_refers_to_function_typed_param_of_typedef() {
@@ -8516,8 +8493,7 @@ var v = h((y) {});
UnlinkedParam y = closure.parameters[0];
expect(y.name, 'y');
EntityRef typeRef = getTypeRefForSlot(y.inferredTypeSlot);
- checkLinkedTypeRef(typeRef, null, null, 'F',
- expectedKind: ReferenceKind.typedef);
+ checkLinkedTypeRef(typeRef, null, 'F', expectedKind: ReferenceKind.typedef);
expect(typeRef.implicitFunctionTypeIndices, [0]);
}
@@ -8537,7 +8513,7 @@ var v = h((y) {});
expect(type.paramReference, 0);
expect(type.typeArguments, hasLength(2));
checkParamTypeRef(type.typeArguments[0], 1);
- checkTypeRef(type.typeArguments[1], 'dart:core', 'dart:core', 'int');
+ checkTypeRef(type.typeArguments[1], 'dart:core', 'int');
expect(type.reference,
greaterThanOrEqualTo(unlinkedUnits[0].references.length));
LinkedReference linkedReference =
@@ -8549,7 +8525,7 @@ var v = h((y) {});
expect(linkedReference.unit, 0);
expect(linkedReference.containingReference, isNot(0));
expect(linkedReference.containingReference, lessThan(type.reference));
- checkReferenceIndex(linkedReference.containingReference, null, null, 'D',
+ checkReferenceIndex(linkedReference.containingReference, null, 'D',
numTypeParameters: 2);
}
@@ -8581,7 +8557,7 @@ var v = h((y) {});
expect(linkedReference.containingReference, isNot(0));
expect(linkedReference.containingReference, lessThan(type.reference));
checkReferenceIndex(
- linkedReference.containingReference, absUri('/b.dart'), 'b.dart', 'E');
+ linkedReference.containingReference, absUri('/b.dart'), 'E');
}
test_inferred_type_refers_to_method_function_typed_parameter_type() {
@@ -8610,7 +8586,7 @@ var v = h((y) {});
expect(linkedReference.unit, 0);
expect(linkedReference.containingReference, isNot(0));
expect(linkedReference.containingReference, lessThan(type.reference));
- checkReferenceIndex(linkedReference.containingReference, null, null, 'D');
+ checkReferenceIndex(linkedReference.containingReference, null, 'D');
}
test_inferred_type_refers_to_nested_function_typed_param() {
@@ -8627,7 +8603,7 @@ var v = f((x, y) {});
UnlinkedParam y = closure.parameters[1];
expect(y.name, 'y');
EntityRef typeRef = getTypeRefForSlot(y.inferredTypeSlot);
- checkLinkedTypeRef(typeRef, null, null, 'f',
+ checkLinkedTypeRef(typeRef, null, 'f',
expectedKind: ReferenceKind.topLevelFunction);
expect(typeRef.implicitFunctionTypeIndices, [0, 1]);
}
@@ -8646,7 +8622,7 @@ var v = f(g: (x, y) {});
UnlinkedParam y = closure.parameters[1];
expect(y.name, 'y');
EntityRef typeRef = getTypeRefForSlot(y.inferredTypeSlot);
- checkLinkedTypeRef(typeRef, null, null, 'f',
+ checkLinkedTypeRef(typeRef, null, 'f',
expectedKind: ReferenceKind.topLevelFunction);
expect(typeRef.implicitFunctionTypeIndices, [0, 1]);
}
@@ -8677,7 +8653,7 @@ var v = f(g: (x, y) {});
expect(linkedReference.unit, 0);
expect(linkedReference.containingReference, isNot(0));
expect(linkedReference.containingReference, lessThan(type.reference));
- checkReferenceIndex(linkedReference.containingReference, null, null, 'D');
+ checkReferenceIndex(linkedReference.containingReference, null, 'D');
}
test_inferred_type_skips_trailing_dynamic() {
@@ -8688,9 +8664,9 @@ var v = f(g: (x, y) {});
serializeClassText('class C { final x = <int, dynamic>{}; }');
EntityRef type = getTypeRefForSlot(cls.fields[0].inferredTypeSlot);
// Check that x has inferred type `Map<int, dynamic>`.
- checkLinkedTypeRef(type, 'dart:core', 'dart:core', 'Map',
+ checkLinkedTypeRef(type, 'dart:core', 'Map',
numTypeParameters: 2, numTypeArguments: 2);
- checkLinkedTypeRef(type.typeArguments[0], 'dart:core', 'dart:core', 'int');
+ checkLinkedTypeRef(type.typeArguments[0], 'dart:core', 'int');
checkLinkedDynamicTypeRef(type.typeArguments[1]);
}
@@ -8701,7 +8677,7 @@ var v = f(g: (x, y) {});
UnlinkedClass cls = serializeClassText('class C { final x = []; }');
EntityRef type = getTypeRefForSlot(cls.fields[0].inferredTypeSlot);
// Check that x has inferred type `List<dynamic>`.
- checkLinkedTypeRef(type, 'dart:core', 'dart:core', 'List',
+ checkLinkedTypeRef(type, 'dart:core', 'List',
numTypeParameters: 1, numTypeArguments: 1);
}
@@ -8710,7 +8686,7 @@ var v = f(g: (x, y) {});
UnlinkedVariable variable = serializeVariableText('int v = null;');
expect(variable.initializer.returnType, isNull);
checkInferredTypeSlot(
- variable.initializer.inferredReturnTypeSlot, null, null, '*bottom*',
+ variable.initializer.inferredReturnTypeSlot, null, '*bottom*',
onlyInStrongMode: false);
}
@@ -8723,10 +8699,10 @@ var v = f(g: (x, y) {});
'import "a.dart"; int v = new C().d;',
allowErrors: true);
expect(variable.initializer.returnType, isNull);
- checkInferredTypeSlot(variable.initializer.inferredReturnTypeSlot,
- absUri('/a.dart'), 'a.dart', 'D',
+ checkInferredTypeSlot(
+ variable.initializer.inferredReturnTypeSlot, absUri('/a.dart'), 'D',
onlyInStrongMode: false);
- checkHasDependency('a.dart', fullyLinked: false);
+ checkHasDependency(absUri('/a.dart'), fullyLinked: false);
}
test_initializer_executable_with_return_type_from_closure() {
@@ -8741,15 +8717,15 @@ var v = f(g: (x, y) {});
serializeVariableText('int v = () => 0;', allowErrors: true);
EntityRef closureType =
getTypeRefForSlot(variable.initializer.inferredReturnTypeSlot);
- checkLinkedTypeRef(closureType, null, null, '',
+ checkLinkedTypeRef(closureType, null, '',
expectedKind: ReferenceKind.function);
int initializerIndex =
definingUnit.references[closureType.reference].containingReference;
- checkReferenceIndex(initializerIndex, null, null, '',
+ checkReferenceIndex(initializerIndex, null, '',
expectedKind: ReferenceKind.function);
int variableIndex =
definingUnit.references[initializerIndex].containingReference;
- checkReferenceIndex(variableIndex, null, null, 'v',
+ checkReferenceIndex(variableIndex, null, 'v',
expectedKind: ReferenceKind.topLevelPropertyAccessor);
expect(definingUnit.references[variableIndex].containingReference, 0);
}
@@ -8772,18 +8748,18 @@ class C {
UnlinkedVariable variable = cls.fields[0];
EntityRef closureType =
getTypeRefForSlot(variable.initializer.inferredReturnTypeSlot);
- checkLinkedTypeRef(closureType, null, null, '',
+ checkLinkedTypeRef(closureType, null, '',
expectedKind: ReferenceKind.function);
int initializerIndex =
definingUnit.references[closureType.reference].containingReference;
- checkReferenceIndex(initializerIndex, null, null, '',
+ checkReferenceIndex(initializerIndex, null, '',
expectedKind: ReferenceKind.function);
int variableIndex =
definingUnit.references[initializerIndex].containingReference;
- checkReferenceIndex(variableIndex, null, null, 'v',
+ checkReferenceIndex(variableIndex, null, 'v',
expectedKind: ReferenceKind.propertyAccessor);
int classIndex = definingUnit.references[variableIndex].containingReference;
- checkReferenceIndex(classIndex, null, null, 'C');
+ checkReferenceIndex(classIndex, null, 'C');
expect(definingUnit.references[classIndex].containingReference, 0);
}
@@ -8805,19 +8781,19 @@ void f() {
UnlinkedVariable variable = executable.localVariables[1];
EntityRef closureType =
getTypeRefForSlot(variable.initializer.inferredReturnTypeSlot);
- checkLinkedTypeRef(closureType, null, null, '',
+ checkLinkedTypeRef(closureType, null, '',
expectedKind: ReferenceKind.function);
int initializerIndex =
definingUnit.references[closureType.reference].containingReference;
- checkReferenceIndex(initializerIndex, null, null, '',
+ checkReferenceIndex(initializerIndex, null, '',
expectedKind: ReferenceKind.function);
int variableIndex =
definingUnit.references[initializerIndex].containingReference;
- checkReferenceIndex(variableIndex, null, null, 'v',
+ checkReferenceIndex(variableIndex, null, 'v',
expectedKind: ReferenceKind.variable, localIndex: 1);
int topLevelFunctionIndex =
definingUnit.references[variableIndex].containingReference;
- checkReferenceIndex(topLevelFunctionIndex, null, null, 'f',
+ checkReferenceIndex(topLevelFunctionIndex, null, 'f',
expectedKind: ReferenceKind.topLevelFunction);
expect(
definingUnit.references[topLevelFunctionIndex].containingReference, 0);
@@ -8833,8 +8809,8 @@ void f() {
'import "a.dart"; int v = new C().d;',
allowErrors: true);
expect(variable.initializer.returnType, isNull);
- checkInferredTypeSlot(variable.initializer.inferredReturnTypeSlot,
- absUri('/b.dart'), 'b.dart', 'D',
+ checkInferredTypeSlot(
+ variable.initializer.inferredReturnTypeSlot, absUri('/b.dart'), 'D',
onlyInStrongMode: false);
if (!skipFullyLinkedData) {
checkHasDependency('b.dart', fullyLinked: true);
@@ -8885,8 +8861,7 @@ library foo;''';
serializeLibraryText(
'library my.lib; part "foo.dart"; part "bar.dart"; C c;',
allowErrors: true);
- checkTypeRef(findVariable('c').type, null, null, 'C',
- expectedTargetUnit: 2);
+ checkTypeRef(findVariable('c').type, null, 'C', expectedTargetUnit: 2);
}
test_lineStarts() {
@@ -8940,13 +8915,13 @@ import 'a.dart';
class C {}
C c;
D d;''');
- checkTypeRef(findVariable('c').type, null, null, 'C');
- checkTypeRef(findVariable('d').type, absUri('/a.dart'), 'a.dart', 'D');
+ checkTypeRef(findVariable('c').type, null, 'C');
+ checkTypeRef(findVariable('d').type, absUri('/a.dart'), 'D');
}
test_localNameShadowsImportPrefix() {
serializeLibraryText('import "dart:async" as a; class a {}; a x;');
- checkTypeRef(findVariable('x').type, null, null, 'a');
+ checkTypeRef(findVariable('x').type, null, 'a');
}
test_metadata_classDeclaration() {
@@ -8971,7 +8946,7 @@ D d;''');
0,
0
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'named',
+ (EntityRef r) => checkTypeRef(r, null, 'named',
expectedKind: ReferenceKind.constructor,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.classOrEnum, 'A')
@@ -8990,11 +8965,14 @@ D d;''');
0,
0
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'named',
+ (EntityRef r) => checkTypeRef(r, null, 'named',
expectedKind: ReferenceKind.constructor,
prefixExpectations: [
- new _PrefixExpectation(ReferenceKind.classOrEnum, 'A',
- absoluteUri: absUri('/foo.dart'), relativeUri: 'foo.dart'),
+ new _PrefixExpectation(
+ ReferenceKind.classOrEnum,
+ 'A',
+ absoluteUri: absUri('/foo.dart'),
+ ),
new _PrefixExpectation(ReferenceKind.prefix, 'foo')
])
]);
@@ -9012,7 +8990,7 @@ D d;''');
0,
0
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'named',
+ (EntityRef r) => checkTypeRef(r, null, 'named',
expectedKind: ReferenceKind.unresolved,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.unresolved, 'A'),
@@ -9033,11 +9011,14 @@ D d;''');
0,
0
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'named',
+ (EntityRef r) => checkTypeRef(r, null, 'named',
expectedKind: ReferenceKind.unresolved,
prefixExpectations: [
- new _PrefixExpectation(ReferenceKind.classOrEnum, 'A',
- absoluteUri: absUri('/foo.dart'), relativeUri: 'foo.dart'),
+ new _PrefixExpectation(
+ ReferenceKind.classOrEnum,
+ 'A',
+ absoluteUri: absUri('/foo.dart'),
+ ),
new _PrefixExpectation(ReferenceKind.prefix, 'foo')
])
]);
@@ -9053,7 +9034,7 @@ D d;''');
0,
0
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'named',
+ (EntityRef r) => checkTypeRef(r, null, 'named',
expectedKind: ReferenceKind.unresolved,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.unresolved, 'A')
@@ -9071,7 +9052,7 @@ D d;''');
0,
0
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'named',
+ (EntityRef r) => checkTypeRef(r, null, 'named',
expectedKind: ReferenceKind.unresolved,
prefixExpectations: [
new _PrefixExpectation(ReferenceKind.classOrEnum, 'A')
@@ -9089,8 +9070,8 @@ D d;''');
0,
0
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'A',
- expectedKind: ReferenceKind.classOrEnum)
+ (EntityRef r) =>
+ checkTypeRef(r, null, 'A', expectedKind: ReferenceKind.classOrEnum)
]);
}
@@ -9105,7 +9086,7 @@ D d;''');
0,
0
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, absUri('/foo.dart'), 'foo.dart', 'A',
+ (EntityRef r) => checkTypeRef(r, absUri('/foo.dart'), 'A',
expectedKind: ReferenceKind.classOrEnum, expectedPrefix: 'foo')
]);
}
@@ -9122,7 +9103,7 @@ D d;''');
0,
0
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'A',
+ (EntityRef r) => checkTypeRef(r, null, 'A',
expectedKind: ReferenceKind.unresolved, expectedPrefix: 'foo')
]);
}
@@ -9137,8 +9118,8 @@ D d;''');
0,
0
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'A',
- expectedKind: ReferenceKind.unresolved)
+ (EntityRef r) =>
+ checkTypeRef(r, null, 'A', expectedKind: ReferenceKind.unresolved)
]);
}
@@ -9153,8 +9134,8 @@ D d;''');
0,
1
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'A',
- expectedKind: ReferenceKind.classOrEnum)
+ (EntityRef r) =>
+ checkTypeRef(r, null, 'A', expectedKind: ReferenceKind.classOrEnum)
]);
}
@@ -9263,8 +9244,8 @@ class C {}
0,
1
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'A',
- expectedKind: ReferenceKind.classOrEnum)
+ (EntityRef r) =>
+ checkTypeRef(r, null, 'A', expectedKind: ReferenceKind.classOrEnum)
]);
}
@@ -9285,8 +9266,8 @@ class C {}
0,
1
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'A',
- expectedKind: ReferenceKind.classOrEnum)
+ (EntityRef r) =>
+ checkTypeRef(r, null, 'A', expectedKind: ReferenceKind.classOrEnum)
]);
}
@@ -9323,13 +9304,13 @@ class C {}
assertUnlinkedConst(annotations[0], operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'a',
+ (EntityRef r) => checkTypeRef(r, null, 'a',
expectedKind: ReferenceKind.topLevelPropertyAccessor)
]);
assertUnlinkedConst(annotations[1], operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'b',
+ (EntityRef r) => checkTypeRef(r, null, 'b',
expectedKind: ReferenceKind.topLevelPropertyAccessor)
]);
}
@@ -9348,7 +9329,7 @@ class C {}
assertUnlinkedConst(cls.annotations[0], operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, absUri('/a.dart'), 'a.dart', 'b',
+ (EntityRef r) => checkTypeRef(r, absUri('/a.dart'), 'b',
expectedKind: ReferenceKind.topLevelPropertyAccessor,
expectedPrefix: 'a')
]);
@@ -9363,7 +9344,7 @@ class C {}
assertUnlinkedConst(cls.annotations[0], operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'b',
+ (EntityRef r) => checkTypeRef(r, null, 'b',
expectedKind: ReferenceKind.unresolved, expectedPrefix: 'a')
]);
}
@@ -9418,8 +9399,8 @@ class C {}
assertUnlinkedConst(cls.annotations[0], operators: [
UnlinkedExprOperation.pushReference
], referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'a',
- expectedKind: ReferenceKind.unresolved)
+ (EntityRef r) =>
+ checkTypeRef(r, null, 'a', expectedKind: ReferenceKind.unresolved)
]);
}
@@ -9461,8 +9442,7 @@ class C {
' abstract class D { void f(int value); }',
className: 'C')
.executables[0];
- checkInferredTypeSlot(
- f.parameters[0].inferredTypeSlot, 'dart:core', 'dart:core', 'int');
+ checkInferredTypeSlot(f.parameters[0].inferredTypeSlot, 'dart:core', 'int');
}
test_method_inferred_type_nonstatic_implicit_return() {
@@ -9470,8 +9450,7 @@ class C {
'class C extends D { f() => null; } abstract class D { int f(); }',
className: 'C')
.executables[0];
- checkInferredTypeSlot(
- f.inferredReturnTypeSlot, 'dart:core', 'dart:core', 'int');
+ checkInferredTypeSlot(f.inferredReturnTypeSlot, 'dart:core', 'int');
}
test_method_inferred_type_static_implicit_param() {
@@ -9704,14 +9683,13 @@ void set f(value) {}''';
' abstract class D { void set f(int value); }',
className: 'C')
.executables[0];
- checkInferredTypeSlot(
- f.parameters[0].inferredTypeSlot, 'dart:core', 'dart:core', 'int');
+ checkInferredTypeSlot(f.parameters[0].inferredTypeSlot, 'dart:core', 'int');
}
test_setter_inferred_type_nonstatic_implicit_return() {
UnlinkedExecutable f =
serializeClassText('class C { set f(int value) {} }').executables[0];
- checkInferredTypeSlot(f.inferredReturnTypeSlot, null, null, 'void');
+ checkInferredTypeSlot(f.inferredReturnTypeSlot, null, 'void');
}
test_setter_inferred_type_static_implicit_param() {
@@ -9769,11 +9747,9 @@ final v = f() ? /*<T>*/(T t) => 0 : /*<T>*/(T t) => 1;
bool f() => true;
''');
EntityRef inferredType = getTypeRefForSlot(variable.inferredTypeSlot);
- checkLinkedTypeRef(
- inferredType.syntheticReturnType, 'dart:core', 'dart:core', 'int');
+ checkLinkedTypeRef(inferredType.syntheticReturnType, 'dart:core', 'int');
expect(inferredType.syntheticParams, hasLength(1));
- checkLinkedTypeRef(
- inferredType.syntheticParams[0].type, null, null, '*bottom*');
+ checkLinkedTypeRef(inferredType.syntheticParams[0].type, null, '*bottom*');
}
test_syntheticFunctionType_genericClosure_inGenericFunction() {
@@ -9795,13 +9771,11 @@ void f<T, U>(bool b) {
}
''').localVariables[0];
EntityRef inferredType = getTypeRefForSlot(variable.inferredTypeSlot);
- checkLinkedTypeRef(
- inferredType.syntheticReturnType, 'dart:core', 'dart:core', 'int');
+ checkLinkedTypeRef(inferredType.syntheticReturnType, 'dart:core', 'int');
expect(inferredType.syntheticParams, hasLength(3));
checkParamTypeRef(inferredType.syntheticParams[0].type, 2);
checkParamTypeRef(inferredType.syntheticParams[1].type, 1);
- checkLinkedTypeRef(
- inferredType.syntheticParams[2].type, null, null, '*bottom*');
+ checkLinkedTypeRef(inferredType.syntheticParams[2].type, null, '*bottom*');
}
test_syntheticFunctionType_inGenericClass() {
@@ -9816,8 +9790,7 @@ bool f() => false;
''').fields[0];
EntityRef inferredType =
getTypeRefForSlot(variable.initializer.inferredReturnTypeSlot);
- checkLinkedTypeRef(
- inferredType.syntheticReturnType, 'dart:core', 'dart:core', 'int');
+ checkLinkedTypeRef(inferredType.syntheticReturnType, 'dart:core', 'int');
checkParamTypeRef(inferredType.syntheticParams[0].type, 2);
checkParamTypeRef(inferredType.syntheticParams[1].type, 1);
}
@@ -9833,29 +9806,28 @@ void f<T, U>(bool b) {
''').localVariables[0];
EntityRef inferredType =
getTypeRefForSlot(variable.initializer.inferredReturnTypeSlot);
- checkLinkedTypeRef(
- inferredType.syntheticReturnType, 'dart:core', 'dart:core', 'int');
+ checkLinkedTypeRef(inferredType.syntheticReturnType, 'dart:core', 'int');
checkParamTypeRef(inferredType.syntheticParams[0].type, 2);
checkParamTypeRef(inferredType.syntheticParams[1].type, 1);
}
test_type_arguments_explicit() {
EntityRef typeRef = serializeTypeText('List<int>');
- checkTypeRef(typeRef, 'dart:core', 'dart:core', 'List',
+ checkTypeRef(typeRef, 'dart:core', 'List',
numTypeParameters: 1, numTypeArguments: 1);
- checkTypeRef(typeRef.typeArguments[0], 'dart:core', 'dart:core', 'int');
+ checkTypeRef(typeRef.typeArguments[0], 'dart:core', 'int');
}
test_type_arguments_explicit_dynamic() {
EntityRef typeRef = serializeTypeText('List<dynamic>');
- checkTypeRef(typeRef, 'dart:core', 'dart:core', 'List',
+ checkTypeRef(typeRef, 'dart:core', 'List',
numTypeParameters: 1, numTypeArguments: 1);
checkDynamicTypeRef(typeRef.typeArguments[0]);
}
test_type_arguments_explicit_dynamic_dynamic() {
EntityRef typeRef = serializeTypeText('Map<dynamic, dynamic>');
- checkTypeRef(typeRef, 'dart:core', 'dart:core', 'Map',
+ checkTypeRef(typeRef, 'dart:core', 'Map',
numTypeParameters: 2, numTypeArguments: 2);
checkDynamicTypeRef(typeRef.typeArguments[0]);
checkDynamicTypeRef(typeRef.typeArguments[1]);
@@ -9863,16 +9835,16 @@ void f<T, U>(bool b) {
test_type_arguments_explicit_dynamic_int() {
EntityRef typeRef = serializeTypeText('Map<dynamic, int>');
- checkTypeRef(typeRef, 'dart:core', 'dart:core', 'Map',
+ checkTypeRef(typeRef, 'dart:core', 'Map',
numTypeParameters: 2, numTypeArguments: 2);
checkDynamicTypeRef(typeRef.typeArguments[0]);
- checkTypeRef(typeRef.typeArguments[1], 'dart:core', 'dart:core', 'int');
+ checkTypeRef(typeRef.typeArguments[1], 'dart:core', 'int');
}
test_type_arguments_explicit_dynamic_typedef() {
EntityRef typeRef =
serializeTypeText('F<dynamic>', otherDeclarations: 'typedef T F<T>();');
- checkTypeRef(typeRef, null, null, 'F',
+ checkTypeRef(typeRef, null, 'F',
expectedKind: ReferenceKind.typedef,
numTypeParameters: 1,
numTypeArguments: 1);
@@ -9881,56 +9853,55 @@ void f<T, U>(bool b) {
test_type_arguments_explicit_String_dynamic() {
EntityRef typeRef = serializeTypeText('Map<String, dynamic>');
- checkTypeRef(typeRef, 'dart:core', 'dart:core', 'Map',
+ checkTypeRef(typeRef, 'dart:core', 'Map',
numTypeParameters: 2, numTypeArguments: 2);
- checkTypeRef(typeRef.typeArguments[0], 'dart:core', 'dart:core', 'String');
+ checkTypeRef(typeRef.typeArguments[0], 'dart:core', 'String');
checkDynamicTypeRef(typeRef.typeArguments[1]);
}
test_type_arguments_explicit_String_int() {
EntityRef typeRef = serializeTypeText('Map<String, int>');
- checkTypeRef(typeRef, 'dart:core', 'dart:core', 'Map',
+ checkTypeRef(typeRef, 'dart:core', 'Map',
numTypeParameters: 2, numTypeArguments: 2);
- checkTypeRef(typeRef.typeArguments[0], 'dart:core', 'dart:core', 'String');
- checkTypeRef(typeRef.typeArguments[1], 'dart:core', 'dart:core', 'int');
+ checkTypeRef(typeRef.typeArguments[0], 'dart:core', 'String');
+ checkTypeRef(typeRef.typeArguments[1], 'dart:core', 'int');
}
test_type_arguments_explicit_typedef() {
EntityRef typeRef =
serializeTypeText('F<int>', otherDeclarations: 'typedef T F<T>();');
- checkTypeRef(typeRef, null, null, 'F',
+ checkTypeRef(typeRef, null, 'F',
expectedKind: ReferenceKind.typedef,
numTypeParameters: 1,
numTypeArguments: 1);
- checkTypeRef(typeRef.typeArguments[0], 'dart:core', 'dart:core', 'int');
+ checkTypeRef(typeRef.typeArguments[0], 'dart:core', 'int');
}
test_type_arguments_implicit() {
EntityRef typeRef = serializeTypeText('List');
- checkTypeRef(typeRef, 'dart:core', 'dart:core', 'List',
- numTypeParameters: 1);
+ checkTypeRef(typeRef, 'dart:core', 'List', numTypeParameters: 1);
}
test_type_arguments_implicit_typedef() {
EntityRef typeRef =
serializeTypeText('F', otherDeclarations: 'typedef T F<T>();');
- checkTypeRef(typeRef, null, null, 'F',
+ checkTypeRef(typeRef, null, 'F',
expectedKind: ReferenceKind.typedef, numTypeParameters: 1);
}
test_type_arguments_implicit_typedef_withBound() {
EntityRef typeRef = serializeTypeText('F',
otherDeclarations: 'typedef T F<T extends num>();');
- checkTypeRef(typeRef, null, null, 'F',
+ checkTypeRef(typeRef, null, 'F',
expectedKind: ReferenceKind.typedef, numTypeParameters: 1);
}
test_type_arguments_order() {
EntityRef typeRef = serializeTypeText('Map<int, Object>');
- checkTypeRef(typeRef, 'dart:core', 'dart:core', 'Map',
+ checkTypeRef(typeRef, 'dart:core', 'Map',
numTypeParameters: 2, numTypeArguments: 2);
- checkTypeRef(typeRef.typeArguments[0], 'dart:core', 'dart:core', 'int');
- checkTypeRef(typeRef.typeArguments[1], 'dart:core', 'dart:core', 'Object');
+ checkTypeRef(typeRef.typeArguments[0], 'dart:core', 'int');
+ checkTypeRef(typeRef.typeArguments[1], 'dart:core', 'Object');
}
test_type_dynamic() {
@@ -9945,7 +9916,7 @@ class C<T> {
''');
UnlinkedExecutable m = c.executables[0];
expect(m.name, 'm');
- checkTypeRef(m.parameters[0].type, null, null, 'dynamic');
+ checkTypeRef(m.parameters[0].type, null, 'dynamic');
}
test_type_param_codeRange() {
@@ -10033,7 +10004,7 @@ class C<T> {
addNamedSource('/a.dart', 'part of foo; C v;');
serializeLibraryText('library foo; part "a.dart"; class C {}');
checkTypeRef(findVariable('v', variables: unlinkedUnits[1].variables).type,
- null, null, 'C',
+ null, 'C',
expectedKind: ReferenceKind.classOrEnum,
linkedSourceUnit: linked.units[1],
unlinkedSourceUnit: unlinkedUnits[1]);
@@ -10046,7 +10017,7 @@ class C<T> {
'library foo; import "a.dart"; import "a.dart" as a; part "p.dart";',
allowErrors: true);
checkTypeRef(findVariable('v', variables: unlinkedUnits[1].variables).type,
- absUri('/a.dart'), 'a.dart', 'C',
+ absUri('/a.dart'), 'C',
expectedPrefix: 'a',
linkedSourceUnit: linked.units[1],
unlinkedSourceUnit: unlinkedUnits[1]);
@@ -10070,7 +10041,7 @@ class C<T> {
addNamedSource('/a.dart', 'library a; export "b.dart";');
addNamedSource('/b.dart', 'library b; class C {}');
checkTypeRef(serializeTypeText('C', otherDeclarations: 'import "a.dart";'),
- absUri('/b.dart'), 'b.dart', 'C');
+ absUri('/b.dart'), 'C');
}
test_type_reference_to_import_of_export_via_prefix() {
@@ -10079,7 +10050,6 @@ class C<T> {
checkTypeRef(
serializeTypeText('p.C', otherDeclarations: 'import "a.dart" as p;'),
absUri('/b.dart'),
- 'b.dart',
'C',
expectedPrefix: 'p');
}
@@ -10091,7 +10061,6 @@ class C<T> {
serializeTypeText('C',
otherDeclarations: 'library my.lib; import "a.dart";'),
absUri('/a.dart'),
- 'a.dart',
'C',
expectedTargetUnit: 1);
}
@@ -10103,15 +10072,14 @@ class C<T> {
serializeTypeText('p.C',
otherDeclarations: 'library my.lib; import "a.dart" as p;'),
absUri('/a.dart'),
- 'a.dart',
'C',
expectedPrefix: 'p',
expectedTargetUnit: 1);
}
test_type_reference_to_internal_class() {
- checkTypeRef(serializeTypeText('C', otherDeclarations: 'class C {}'), null,
- null, 'C');
+ checkTypeRef(
+ serializeTypeText('C', otherDeclarations: 'class C {}'), null, 'C');
}
test_type_reference_to_internal_class_alias() {
@@ -10119,13 +10087,12 @@ class C<T> {
serializeTypeText('C',
otherDeclarations: 'class C = D with E; class D {} class E {}'),
null,
- null,
'C');
}
test_type_reference_to_internal_enum() {
checkTypeRef(serializeTypeText('E', otherDeclarations: 'enum E { value }'),
- null, null, 'E');
+ null, 'E');
}
test_type_reference_to_local_part() {
@@ -10134,7 +10101,6 @@ class C<T> {
serializeTypeText('C',
otherDeclarations: 'library my.lib; part "a.dart";'),
null,
- null,
'C',
expectedTargetUnit: 1);
}
@@ -10149,7 +10115,7 @@ class C<T> {
test_type_reference_to_part() {
addNamedSource('/a.dart', 'part of foo; class C { C(); }');
serializeLibraryText('library foo; part "a.dart"; C c;');
- checkTypeRef(unlinkedUnits[0].variables.single.type, null, null, 'C',
+ checkTypeRef(unlinkedUnits[0].variables.single.type, null, 'C',
expectedKind: ReferenceKind.classOrEnum, expectedTargetUnit: 1);
}
@@ -10168,19 +10134,16 @@ b.C c4;''');
// Note: it is important that each reference to class C records the prefix
// used to find it; otherwise it's possible that relinking might produce an
// incorrect result after a change to lib2.dart, lib3.dart, or lib4.dart.
- checkTypeRef(
- findVariable('c2').type, absUri('/lib1.dart'), 'lib1.dart', 'C');
- checkTypeRef(
- findVariable('c3').type, absUri('/lib1.dart'), 'lib1.dart', 'C',
+ checkTypeRef(findVariable('c2').type, absUri('/lib1.dart'), 'C');
+ checkTypeRef(findVariable('c3').type, absUri('/lib1.dart'), 'C',
expectedPrefix: 'a');
- checkTypeRef(
- findVariable('c4').type, absUri('/lib1.dart'), 'lib1.dart', 'C',
+ checkTypeRef(findVariable('c4').type, absUri('/lib1.dart'), 'C',
expectedPrefix: 'b');
}
test_type_reference_to_typedef() {
checkTypeRef(serializeTypeText('F', otherDeclarations: 'typedef void F();'),
- null, null, 'F',
+ null, 'F',
expectedKind: ReferenceKind.typedef);
}
@@ -10193,8 +10156,7 @@ b.C c4;''');
// The referenced unit should be 2, since unit 0 is a.dart and unit 1 is
// b.dart. a.dart and b.dart are counted even though nothing is imported
// from them.
- checkTypeRef(typeRef, absUri('/a.dart'), 'a.dart', 'C',
- expectedTargetUnit: 2);
+ checkTypeRef(typeRef, absUri('/a.dart'), 'C', expectedTargetUnit: 2);
}
test_type_unresolved() {
@@ -10255,7 +10217,7 @@ typedef F();''';
test_typedef_reference_generic() {
EntityRef typeRef =
serializeTypeText('F', otherDeclarations: 'typedef void F<A, B>();');
- checkTypeRef(typeRef, null, null, 'F',
+ checkTypeRef(typeRef, null, 'F',
numTypeParameters: 2, expectedKind: ReferenceKind.typedef);
}
@@ -10263,13 +10225,13 @@ typedef F();''';
addNamedSource('/lib.dart', 'typedef void F<A, B>();');
EntityRef typeRef =
serializeTypeText('F', otherDeclarations: 'import "lib.dart";');
- checkTypeRef(typeRef, absUri('/lib.dart'), 'lib.dart', 'F',
+ checkTypeRef(typeRef, absUri('/lib.dart'), 'F',
numTypeParameters: 2, expectedKind: ReferenceKind.typedef);
}
test_typedef_return_type_explicit() {
UnlinkedTypedef type = serializeTypedefText('typedef int F();');
- checkTypeRef(type.returnType, 'dart:core', 'dart:core', 'int');
+ checkTypeRef(type.returnType, 'dart:core', 'int');
}
test_typedef_type_param_in_parameter() {
@@ -10308,8 +10270,7 @@ typedef F();''';
expect(unlinkedUnits[0].publicNamespace.exports, hasLength(1));
expect(unlinkedUnits[0].publicNamespace.exports[0].uri, 'foo.dart');
expect(linked.exportDependencies, hasLength(1));
- checkDependency(
- linked.exportDependencies[0], absUri('/foo.dart'), 'foo.dart');
+ checkDependency(linked.exportDependencies[0], absUri('/foo.dart'));
}
test_unresolved_import() {
@@ -10320,8 +10281,7 @@ typedef F();''';
// Note: imports[1] is the implicit import of dart:core.
expect(unlinkedUnits[0].imports[1].isImplicit, true);
expect(linked.importDependencies, hasLength(2));
- checkDependency(
- linked.importDependencies[0], absUri('/foo.dart'), 'foo.dart');
+ checkDependency(linked.importDependencies[0], absUri('/foo.dart'));
}
test_unresolved_part() {
@@ -10369,7 +10329,7 @@ var v = c.f;
EntityRef type =
getTypeRefForSlot(variable.initializer.inferredReturnTypeSlot);
expect(type.typeArguments, hasLength(1));
- checkLinkedTypeRef(type.typeArguments[0], 'dart:core', 'dart:core', 'int');
+ checkLinkedTypeRef(type.typeArguments[0], 'dart:core', 'int');
}
test_variable() {
@@ -10447,7 +10407,7 @@ var v;''';
test_variable_inferred_type_implicit_initialized() {
UnlinkedVariable v = serializeVariableText('var v = 0;');
- checkInferredTypeSlot(v.inferredTypeSlot, 'dart:core', 'dart:core', 'int');
+ checkInferredTypeSlot(v.inferredTypeSlot, 'dart:core', 'int');
}
test_variable_inferred_type_implicit_uninitialized() {
@@ -10578,7 +10538,7 @@ var v;''';
test_variable_type() {
UnlinkedVariable variable =
serializeVariableText('int i;', variableName: 'i');
- checkTypeRef(variable.type, 'dart:core', 'dart:core', 'int');
+ checkTypeRef(variable.type, 'dart:core', 'int');
}
/**
@@ -10650,7 +10610,7 @@ final v = $expr;
],
strings: [],
referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'a',
+ (EntityRef r) => checkTypeRef(r, null, 'a',
expectedKind: ReferenceKind.topLevelPropertyAccessor)
]);
}
@@ -10712,7 +10672,7 @@ final v = $expr;
],
strings: [],
referenceValidators: [
- (EntityRef r) => checkTypeRef(r, null, null, 'a',
+ (EntityRef r) => checkTypeRef(r, null, 'a',
expectedKind: ReferenceKind.topLevelPropertyAccessor)
]);
}
@@ -10734,9 +10694,8 @@ class _PrefixExpectation {
final ReferenceKind kind;
final String name;
final String absoluteUri;
- final String relativeUri;
final int numTypeParameters;
_PrefixExpectation(this.kind, this.name,
- {this.absoluteUri, this.relativeUri, this.numTypeParameters: 0});
+ {this.absoluteUri, this.numTypeParameters: 0});
}

Powered by Google App Engine
This is Rietveld 408576698