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

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

Issue 707073002: Fix analyzer's treatment of mixin constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Improve error message. Created 6 years, 1 month 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 | Annotate | Revision Log
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:collection';
8 import "dart:math" as math; 8 import "dart:math" as math;
9 9
10 import 'java_core.dart'; 10 import 'java_core.dart';
(...skipping 5738 matching lines...) Expand 10 before | Expand all | Expand 10 after
5749 if (superclassElement != null) { 5749 if (superclassElement != null) {
5750 List<ConstructorElement> constructors = superclassElement.constructors; 5750 List<ConstructorElement> constructors = superclassElement.constructors;
5751 int count = constructors.length; 5751 int count = constructors.length;
5752 if (count > 0) { 5752 if (count > 0) {
5753 List<DartType> parameterTypes = TypeParameterTypeImpl.getTypes(supercl assType.typeParameters); 5753 List<DartType> parameterTypes = TypeParameterTypeImpl.getTypes(supercl assType.typeParameters);
5754 List<DartType> argumentTypes = _getArgumentTypes(node.superclass.typeA rguments, parameterTypes); 5754 List<DartType> argumentTypes = _getArgumentTypes(node.superclass.typeA rguments, parameterTypes);
5755 InterfaceType classType = classElement.type; 5755 InterfaceType classType = classElement.type;
5756 List<ConstructorElement> implicitConstructors = new List<ConstructorEl ement>(); 5756 List<ConstructorElement> implicitConstructors = new List<ConstructorEl ement>();
5757 for (int i = 0; i < count; i++) { 5757 for (int i = 0; i < count; i++) {
5758 ConstructorElement explicitConstructor = constructors[i]; 5758 ConstructorElement explicitConstructor = constructors[i];
5759 if (!explicitConstructor.isFactory) { 5759 if (!explicitConstructor.isFactory &&
5760 classElement.isSuperConstructorAccessible(explicitConstructor)) {
5760 implicitConstructors.add(_createImplicitContructor(classType, expl icitConstructor, parameterTypes, argumentTypes)); 5761 implicitConstructors.add(_createImplicitContructor(classType, expl icitConstructor, parameterTypes, argumentTypes));
5761 } 5762 }
5762 } 5763 }
5764 if (implicitConstructors.isEmpty) {
5765 reportErrorForNode(CompileTimeErrorCode.MIXIN_HAS_NO_CONSTRUCTORS,
5766 node, [superclassElement.name]);
5767 }
5763 classElement.constructors = implicitConstructors; 5768 classElement.constructors = implicitConstructors;
5764 } 5769 }
5765 } 5770 }
5766 } 5771 }
5767 return null; 5772 return null;
5768 } 5773 }
5769 5774
5770 @override 5775 @override
5771 Object visitEnumDeclaration(EnumDeclaration node) => null; 5776 Object visitEnumDeclaration(EnumDeclaration node) => null;
5772 5777
(...skipping 9783 matching lines...) Expand 10 before | Expand all | Expand 10 after
15556 /** 15561 /**
15557 * Return the tag that has the given identifier, or {@code null} if there is n o such tag (the 15562 * Return the tag that has the given identifier, or {@code null} if there is n o such tag (the
15558 * identifier is not defined). 15563 * identifier is not defined).
15559 * 15564 *
15560 * @return the tag that has the given identifier 15565 * @return the tag that has the given identifier
15561 */ 15566 */
15562 String getTagWithId(String identifier) { 15567 String getTagWithId(String identifier) {
15563 return idToTagMap[identifier]; 15568 return idToTagMap[identifier];
15564 } 15569 }
15565 } 15570 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/error_verifier.dart ('k') | pkg/analyzer/test/generated/all_the_rest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698