| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library analyzer.test.generated.resolver_test_case; | 5 library analyzer.test.generated.resolver_test_case; |
| 6 | 6 |
| 7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
| 8 import 'package:analyzer/dart/ast/visitor.dart'; | 8 import 'package:analyzer/dart/ast/visitor.dart'; |
| 9 import 'package:analyzer/dart/element/element.dart'; | 9 import 'package:analyzer/dart/element/element.dart'; |
| 10 import 'package:analyzer/dart/element/type.dart'; | 10 import 'package:analyzer/dart/element/type.dart'; |
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 FileBasedSource definingCompilationUnitSource = createNamedSource(fileName); | 539 FileBasedSource definingCompilationUnitSource = createNamedSource(fileName); |
| 540 List<CompilationUnitElement> sourcedCompilationUnits; | 540 List<CompilationUnitElement> sourcedCompilationUnits; |
| 541 if (typeNames == null) { | 541 if (typeNames == null) { |
| 542 sourcedCompilationUnits = CompilationUnitElement.EMPTY_LIST; | 542 sourcedCompilationUnits = CompilationUnitElement.EMPTY_LIST; |
| 543 } else { | 543 } else { |
| 544 int count = typeNames.length; | 544 int count = typeNames.length; |
| 545 sourcedCompilationUnits = new List<CompilationUnitElement>(count); | 545 sourcedCompilationUnits = new List<CompilationUnitElement>(count); |
| 546 for (int i = 0; i < count; i++) { | 546 for (int i = 0; i < count; i++) { |
| 547 String typeName = typeNames[i]; | 547 String typeName = typeNames[i]; |
| 548 ClassElementImpl type = | 548 ClassElementImpl type = |
| 549 new ClassElementImpl.forNode(AstFactory.identifier3(typeName)); | 549 new ClassElementImpl_Class.forNode(AstFactory.identifier3(typeName))
; |
| 550 String fileName = "$typeName.dart"; | 550 String fileName = "$typeName.dart"; |
| 551 CompilationUnitElementImpl compilationUnit = | 551 CompilationUnitElementImpl compilationUnit = |
| 552 new CompilationUnitElementImpl(fileName); | 552 new CompilationUnitElementImpl(fileName); |
| 553 compilationUnit.source = createNamedSource(fileName); | 553 compilationUnit.source = createNamedSource(fileName); |
| 554 compilationUnit.librarySource = definingCompilationUnitSource; | 554 compilationUnit.librarySource = definingCompilationUnitSource; |
| 555 compilationUnit.types = <ClassElement>[type]; | 555 compilationUnit.types = <ClassElement>[type]; |
| 556 sourcedCompilationUnits[i] = compilationUnit; | 556 sourcedCompilationUnits[i] = compilationUnit; |
| 557 } | 557 } |
| 558 } | 558 } |
| 559 CompilationUnitElementImpl compilationUnit = | 559 CompilationUnitElementImpl compilationUnit = |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 837 * text. Otherwise, [expected] is used directly a [Matcher] to match the type. | 837 * text. Otherwise, [expected] is used directly a [Matcher] to match the type. |
| 838 */ | 838 */ |
| 839 _expectType(DartType type, expected) { | 839 _expectType(DartType type, expected) { |
| 840 if (expected is String) { | 840 if (expected is String) { |
| 841 expect(type.toString(), expected); | 841 expect(type.toString(), expected); |
| 842 } else { | 842 } else { |
| 843 expect(type, expected); | 843 expect(type, expected); |
| 844 } | 844 } |
| 845 } | 845 } |
| 846 } | 846 } |
| OLD | NEW |