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

Side by Side Diff: pkg/analyzer/lib/src/dart/element/element.dart

Issue 3000183002: Fix ClassElement.allSupertypes to include interfaces of mixins (issue 29767) (Closed)
Patch Set: address comments Created 3 years, 4 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 analyzer.src.dart.element.element; 5 library analyzer.src.dart.element.element;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import 'dart:math' show min; 8 import 'dart:math' show min;
9 9
10 import 'package:analyzer/dart/ast/ast.dart'; 10 import 'package:analyzer/dart/ast/ast.dart';
(...skipping 1136 matching lines...) Expand 10 before | Expand all | Expand 10 after
1147 ClassElement currentElement = currentType.element; 1147 ClassElement currentElement = currentType.element;
1148 if (!visitedClasses.contains(currentElement)) { 1148 if (!visitedClasses.contains(currentElement)) {
1149 visitedClasses.add(currentElement); 1149 visitedClasses.add(currentElement);
1150 if (!identical(currentType, this.type)) { 1150 if (!identical(currentType, this.type)) {
1151 supertypes.add(currentType); 1151 supertypes.add(currentType);
1152 } 1152 }
1153 InterfaceType supertype = currentType.superclass; 1153 InterfaceType supertype = currentType.superclass;
1154 if (supertype != null) { 1154 if (supertype != null) {
1155 typesToVisit.add(supertype); 1155 typesToVisit.add(supertype);
1156 } 1156 }
1157 for (InterfaceType type in currentElement.interfaces) { 1157 for (InterfaceType type in currentType.interfaces) {
1158 typesToVisit.add(type); 1158 typesToVisit.add(type);
1159 } 1159 }
1160 for (InterfaceType type in currentElement.mixins) { 1160 for (InterfaceType type in currentType.mixins) {
1161 ClassElement element = type.element; 1161 typesToVisit.add(type);
1162 if (!visitedClasses.contains(element)) {
1163 supertypes.add(type);
1164 }
1165 } 1162 }
1166 } 1163 }
1167 } 1164 }
1168 } 1165 }
1169 1166
1170 /** 1167 /**
1171 * Compute a list of constructors for this class, which is a mixin 1168 * Compute a list of constructors for this class, which is a mixin
1172 * application. If specified, [visitedClasses] is a list of the other mixin 1169 * application. If specified, [visitedClasses] is a list of the other mixin
1173 * application classes which have been visited on the way to reaching this 1170 * application classes which have been visited on the way to reaching this
1174 * one (this is used to detect circularities). 1171 * one (this is used to detect circularities).
(...skipping 8764 matching lines...) Expand 10 before | Expand all | Expand 10 after
9939 9936
9940 @override 9937 @override
9941 DartObject computeConstantValue() => null; 9938 DartObject computeConstantValue() => null;
9942 9939
9943 @override 9940 @override
9944 void visitChildren(ElementVisitor visitor) { 9941 void visitChildren(ElementVisitor visitor) {
9945 super.visitChildren(visitor); 9942 super.visitChildren(visitor);
9946 _initializer?.accept(visitor); 9943 _initializer?.accept(visitor);
9947 } 9944 }
9948 } 9945 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698