| Index: pkg/analyzer/test/generated/resolver_test.dart
|
| diff --git a/pkg/analyzer/test/generated/resolver_test.dart b/pkg/analyzer/test/generated/resolver_test.dart
|
| index 173c84f4bef2643692d30169c6b86519af04f388..0198ed3c9c5aaf20043694a4e776f84db9da6dbc 100644
|
| --- a/pkg/analyzer/test/generated/resolver_test.dart
|
| +++ b/pkg/analyzer/test/generated/resolver_test.dart
|
| @@ -7,6 +7,7 @@ library analyzer.test.generated.resolver_test;
|
| import 'dart:collection';
|
|
|
| import 'package:analyzer/dart/ast/ast.dart';
|
| +import 'package:analyzer/dart/ast/resolution_accessors.dart';
|
| import 'package:analyzer/dart/ast/standard_ast_factory.dart';
|
| import 'package:analyzer/dart/ast/token.dart';
|
| import 'package:analyzer/dart/ast/visitor.dart';
|
| @@ -479,9 +480,9 @@ class StaticTypeVerifier extends GeneralizingAstVisitor<Object> {
|
| buffer.write(" ");
|
| buffer.write(expression.toString());
|
| buffer.write(" [");
|
| - buffer.write(expression.staticType.displayName);
|
| + buffer.write(staticTypeForExpression(expression).displayName);
|
| buffer.write(", ");
|
| - buffer.write(expression.propagatedType.displayName);
|
| + buffer.write(propagatedTypeForExpression(expression).displayName);
|
| buffer.writeln("]");
|
| buffer.write(" ");
|
| buffer.write(_getFileName(expression));
|
| @@ -538,7 +539,7 @@ class StaticTypeVerifier extends GeneralizingAstVisitor<Object> {
|
| Object visitPrefixedIdentifier(PrefixedIdentifier node) {
|
| // In cases where we have a prefixed identifier where the prefix is dynamic,
|
| // we don't want to assert that the node will have a type.
|
| - if (node.staticType == null && node.prefix.staticType.isDynamic) {
|
| + if (node.staticType == null && staticTypeForExpression(node.prefix).isDynamic) {
|
| return null;
|
| }
|
| return super.visitPrefixedIdentifier(node);
|
| @@ -589,7 +590,7 @@ class StaticTypeVerifier extends GeneralizingAstVisitor<Object> {
|
| if (root is CompilationUnit) {
|
| CompilationUnit rootCU = root;
|
| if (rootCU.element != null) {
|
| - return rootCU.element.source.fullName;
|
| + return elementForCompilationUnit(rootCU).source.fullName;
|
| } else {
|
| return "<unknown file- CompilationUnit.getElement() returned null>";
|
| }
|
| @@ -1085,7 +1086,7 @@ A f(var p) {
|
| verify([source]);
|
| CompilationUnit unit = resolveCompilationUnit(source, library);
|
| ClassDeclaration classA = unit.declarations[0] as ClassDeclaration;
|
| - InterfaceType typeA = classA.element.type;
|
| + InterfaceType typeA = elementForClassDeclaration(classA).type;
|
| FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
|
| BlockFunctionBody body =
|
| function.functionExpression.body as BlockFunctionBody;
|
| @@ -1108,7 +1109,7 @@ A f(var p) {
|
| verify([source]);
|
| CompilationUnit unit = resolveCompilationUnit(source, library);
|
| ClassDeclaration classA = unit.declarations[0] as ClassDeclaration;
|
| - InterfaceType typeA = classA.element.type;
|
| + InterfaceType typeA = elementForClassDeclaration(classA).type;
|
| FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
|
| BlockFunctionBody body =
|
| function.functionExpression.body as BlockFunctionBody;
|
| @@ -1203,7 +1204,7 @@ main(CanvasElement canvas) {
|
| CompilationUnit unit = resolveCompilationUnit(source, library);
|
| SimpleIdentifier identifier = EngineTestCase.findNode(
|
| unit, code, "context", (node) => node is SimpleIdentifier);
|
| - expect(identifier.propagatedType.name, "CanvasRenderingContext2D");
|
| + expect(propagatedTypeForExpression(identifier).name, "CanvasRenderingContext2D");
|
| }
|
|
|
| void test_forEach() {
|
| @@ -1656,7 +1657,7 @@ A f(var p) {
|
| verify([source]);
|
| CompilationUnit unit = resolveCompilationUnit(source, library);
|
| ClassDeclaration classA = unit.declarations[0] as ClassDeclaration;
|
| - InterfaceType typeA = classA.element.type;
|
| + InterfaceType typeA = elementForClassDeclaration(classA).type;
|
| FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
|
| BlockFunctionBody body =
|
| function.functionExpression.body as BlockFunctionBody;
|
| @@ -1686,7 +1687,7 @@ A f(var p) {
|
| InterfaceType typeA;
|
| {
|
| ClassDeclaration classA = unit.declarations[0] as ClassDeclaration;
|
| - typeA = classA.element.type;
|
| + typeA = elementForClassDeclaration(classA).type;
|
| }
|
| // verify "f"
|
| FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
|
| @@ -1749,7 +1750,7 @@ A f(var p) {
|
| verify([source]);
|
| CompilationUnit unit = resolveCompilationUnit(source, library);
|
| ClassDeclaration classA = unit.declarations[0] as ClassDeclaration;
|
| - InterfaceType typeA = classA.element.type;
|
| + InterfaceType typeA = elementForClassDeclaration(classA).type;
|
| FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
|
| BlockFunctionBody body =
|
| function.functionExpression.body as BlockFunctionBody;
|
| @@ -1772,7 +1773,7 @@ A f(var p) {
|
| verify([source]);
|
| CompilationUnit unit = resolveCompilationUnit(source, library);
|
| ClassDeclaration classA = unit.declarations[0] as ClassDeclaration;
|
| - InterfaceType typeA = classA.element.type;
|
| + InterfaceType typeA = elementForClassDeclaration(classA).type;
|
| FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
|
| BlockFunctionBody body =
|
| function.functionExpression.body as BlockFunctionBody;
|
| @@ -1797,7 +1798,7 @@ A f(var p) {
|
| verify([source]);
|
| CompilationUnit unit = resolveCompilationUnit(source, library);
|
| ClassDeclaration classA = unit.declarations[0] as ClassDeclaration;
|
| - InterfaceType typeA = classA.element.type;
|
| + InterfaceType typeA = elementForClassDeclaration(classA).type;
|
| FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
|
| BlockFunctionBody body =
|
| function.functionExpression.body as BlockFunctionBody;
|
| @@ -1846,7 +1847,7 @@ A f(var p) {
|
| verify([source]);
|
| CompilationUnit unit = resolveCompilationUnit(source, library);
|
| ClassDeclaration classA = unit.declarations[0] as ClassDeclaration;
|
| - InterfaceType typeA = classA.element.type;
|
| + InterfaceType typeA = elementForClassDeclaration(classA).type;
|
| FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
|
| BlockFunctionBody body =
|
| function.functionExpression.body as BlockFunctionBody;
|
| @@ -1868,7 +1869,7 @@ A f(var p) {
|
| verify([source]);
|
| CompilationUnit unit = resolveCompilationUnit(source, library);
|
| ClassDeclaration classA = unit.declarations[0] as ClassDeclaration;
|
| - InterfaceType typeA = classA.element.type;
|
| + InterfaceType typeA = elementForClassDeclaration(classA).type;
|
| FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
|
| BlockFunctionBody body =
|
| function.functionExpression.body as BlockFunctionBody;
|
| @@ -1895,7 +1896,7 @@ A f(var p) {
|
| verify([source]);
|
| CompilationUnit unit = resolveCompilationUnit(source, library);
|
| ClassDeclaration classA = unit.declarations[0] as ClassDeclaration;
|
| - InterfaceType typeA = classA.element.type;
|
| + InterfaceType typeA = elementForClassDeclaration(classA).type;
|
| FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
|
| BlockFunctionBody body =
|
| function.functionExpression.body as BlockFunctionBody;
|
| @@ -1920,7 +1921,7 @@ A f(var p) {
|
| assertNoErrors(source);
|
| CompilationUnit unit = resolveCompilationUnit(source, library);
|
| ClassDeclaration classA = unit.declarations[0] as ClassDeclaration;
|
| - InterfaceType typeA = classA.element.type;
|
| + InterfaceType typeA = elementForClassDeclaration(classA).type;
|
| FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
|
| BlockFunctionBody body =
|
| function.functionExpression.body as BlockFunctionBody;
|
| @@ -1943,7 +1944,7 @@ A f(var p) {
|
| verify([source]);
|
| CompilationUnit unit = resolveCompilationUnit(source, library);
|
| ClassDeclaration classA = unit.declarations[0] as ClassDeclaration;
|
| - InterfaceType typeA = classA.element.type;
|
| + InterfaceType typeA = elementForClassDeclaration(classA).type;
|
| FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
|
| BlockFunctionBody body =
|
| function.functionExpression.body as BlockFunctionBody;
|
| @@ -1966,7 +1967,7 @@ A f(var p) {
|
| verify([source]);
|
| CompilationUnit unit = resolveCompilationUnit(source, library);
|
| ClassDeclaration classA = unit.declarations[0] as ClassDeclaration;
|
| - InterfaceType typeA = classA.element.type;
|
| + InterfaceType typeA = elementForClassDeclaration(classA).type;
|
| FunctionDeclaration function = unit.declarations[1] as FunctionDeclaration;
|
| BlockFunctionBody body =
|
| function.functionExpression.body as BlockFunctionBody;
|
| @@ -2416,17 +2417,17 @@ main() {
|
| ReturnStatement statement = body.block.statements[11] as ReturnStatement;
|
| NodeList<Expression> elements =
|
| (statement.expression as ListLiteral).elements;
|
| - expect(elements[0].propagatedType.name, "AnchorElement");
|
| - expect(elements[1].propagatedType.name, "AnchorElement");
|
| - expect(elements[2].propagatedType.name, "BodyElement");
|
| - expect(elements[3].propagatedType.name, "ButtonElement");
|
| - expect(elements[4].propagatedType.name, "DivElement");
|
| - expect(elements[5].propagatedType.name, "InputElement");
|
| - expect(elements[6].propagatedType.name, "SelectElement");
|
| - expect(elements[7].propagatedType.name, "DivElement");
|
| - expect(elements[8].propagatedType.name, "Element");
|
| - expect(elements[9].propagatedType.name, "Element");
|
| - expect(elements[10].propagatedType.name, "Element");
|
| + expect(propagatedTypeForExpression(elements[0]).name, "AnchorElement");
|
| + expect(propagatedTypeForExpression(elements[1]).name, "AnchorElement");
|
| + expect(propagatedTypeForExpression(elements[2]).name, "BodyElement");
|
| + expect(propagatedTypeForExpression(elements[3]).name, "ButtonElement");
|
| + expect(propagatedTypeForExpression(elements[4]).name, "DivElement");
|
| + expect(propagatedTypeForExpression(elements[5]).name, "InputElement");
|
| + expect(propagatedTypeForExpression(elements[6]).name, "SelectElement");
|
| + expect(propagatedTypeForExpression(elements[7]).name, "DivElement");
|
| + expect(propagatedTypeForExpression(elements[8]).name, "Element");
|
| + expect(propagatedTypeForExpression(elements[9]).name, "Element");
|
| + expect(propagatedTypeForExpression(elements[10]).name, "Element");
|
| }
|
| }
|
|
|
|
|