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

Side by Side Diff: pkg/analyzer/lib/src/generated/resolver.dart

Issue 1158193008: Eliminate Modifier.TYPEDEF and deprecate ClassElement.isTypedef. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 engine.resolver; 5 library engine.resolver;
6 6
7 import 'dart:collection';
7 import "dart:math" as math; 8 import "dart:math" as math;
8 import 'dart:collection';
9 9
10 import 'package:analyzer/src/generated/utilities_collection.dart'; 10 import 'package:analyzer/src/generated/utilities_collection.dart';
11 11
12 import 'ast.dart'; 12 import 'ast.dart';
13 import 'constant.dart'; 13 import 'constant.dart';
14 import 'element.dart'; 14 import 'element.dart';
15 import 'element_resolver.dart'; 15 import 'element_resolver.dart';
16 import 'engine.dart'; 16 import 'engine.dart';
17 import 'error.dart'; 17 import 'error.dart';
18 import 'error_verifier.dart'; 18 import 'error_verifier.dart';
(...skipping 2477 matching lines...) Expand 10 before | Expand all | Expand 10 after
2496 2496
2497 @override 2497 @override
2498 Object visitClassTypeAlias(ClassTypeAlias node) { 2498 Object visitClassTypeAlias(ClassTypeAlias node) {
2499 ElementHolder holder = new ElementHolder(); 2499 ElementHolder holder = new ElementHolder();
2500 _functionTypesToFix = new List<FunctionTypeImpl>(); 2500 _functionTypesToFix = new List<FunctionTypeImpl>();
2501 _visitChildren(holder, node); 2501 _visitChildren(holder, node);
2502 SimpleIdentifier className = node.name; 2502 SimpleIdentifier className = node.name;
2503 ClassElementImpl element = new ClassElementImpl.forNode(className); 2503 ClassElementImpl element = new ClassElementImpl.forNode(className);
2504 element.abstract = node.abstractKeyword != null; 2504 element.abstract = node.abstractKeyword != null;
2505 element.mixinApplication = true; 2505 element.mixinApplication = true;
2506 element.typedef = true;
2507 List<TypeParameterElement> typeParameters = holder.typeParameters; 2506 List<TypeParameterElement> typeParameters = holder.typeParameters;
2508 element.typeParameters = typeParameters; 2507 element.typeParameters = typeParameters;
2509 List<DartType> typeArguments = _createTypeParameterTypes(typeParameters); 2508 List<DartType> typeArguments = _createTypeParameterTypes(typeParameters);
2510 InterfaceTypeImpl interfaceType = new InterfaceTypeImpl(element); 2509 InterfaceTypeImpl interfaceType = new InterfaceTypeImpl(element);
2511 interfaceType.typeArguments = typeArguments; 2510 interfaceType.typeArguments = typeArguments;
2512 element.type = interfaceType; 2511 element.type = interfaceType;
2513 // set default constructor 2512 // set default constructor
2514 element.constructors = _createDefaultConstructors(interfaceType); 2513 element.constructors = _createDefaultConstructors(interfaceType);
2515 for (FunctionTypeImpl functionType in _functionTypesToFix) { 2514 for (FunctionTypeImpl functionType in _functionTypesToFix) {
2516 functionType.typeArguments = typeArguments; 2515 functionType.typeArguments = typeArguments;
(...skipping 2634 matching lines...) Expand 10 before | Expand all | Expand 10 after
5151 * Initialize a newly created visitor to build implicit constructors. 5150 * Initialize a newly created visitor to build implicit constructors.
5152 * 5151 *
5153 * The visit methods will pass closures to [_callback] to indicate what 5152 * The visit methods will pass closures to [_callback] to indicate what
5154 * computation needs to be performed, and its dependency order. 5153 * computation needs to be performed, and its dependency order.
5155 */ 5154 */
5156 ImplicitConstructorBuilder(this.errorListener, this._callback); 5155 ImplicitConstructorBuilder(this.errorListener, this._callback);
5157 5156
5158 @override 5157 @override
5159 void visitClassElement(ClassElement classElement) { 5158 void visitClassElement(ClassElement classElement) {
5160 (classElement as ClassElementImpl).mixinErrorsReported = false; 5159 (classElement as ClassElementImpl).mixinErrorsReported = false;
5161 if (classElement.isTypedef) { 5160 if (classElement.isMixinApplication) {
5162 _visitClassTypeAlias(classElement); 5161 _visitClassTypeAlias(classElement);
5163 } else { 5162 } else {
5164 _visitClassDeclaration(classElement); 5163 _visitClassDeclaration(classElement);
5165 } 5164 }
5166 } 5165 }
5167 5166
5168 @override 5167 @override
5169 void visitCompilationUnitElement(CompilationUnitElement element) { 5168 void visitCompilationUnitElement(CompilationUnitElement element) {
5170 element.types.forEach(visitClassElement); 5169 element.types.forEach(visitClassElement);
5171 } 5170 }
(...skipping 10300 matching lines...) Expand 10 before | Expand all | Expand 10 after
15472 nonFields.add(node); 15471 nonFields.add(node);
15473 return null; 15472 return null;
15474 } 15473 }
15475 15474
15476 @override 15475 @override
15477 Object visitNode(AstNode node) => node.accept(TypeResolverVisitor_this); 15476 Object visitNode(AstNode node) => node.accept(TypeResolverVisitor_this);
15478 15477
15479 @override 15478 @override
15480 Object visitWithClause(WithClause node) => null; 15479 Object visitWithClause(WithClause node) => null;
15481 } 15480 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/error_verifier.dart ('k') | pkg/analyzer/lib/src/generated/testing/element_factory.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698