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

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

Issue 1216393002: Exclude members from Object when adding members from mixins (issue 23606) (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/non_error_resolver_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8
9 import 'ast.dart'; 9 import 'ast.dart';
10 import 'constant.dart'; 10 import 'constant.dart';
(...skipping 5751 matching lines...) Expand 10 before | Expand all | Expand 10 after
5762 // Include the members from the superclass in the resultMap. 5762 // Include the members from the superclass in the resultMap.
5763 // 5763 //
5764 _recordMapWithClassMembers(map, mixin, false); 5764 _recordMapWithClassMembers(map, mixin, false);
5765 // 5765 //
5766 // Add the members from map into result map. 5766 // Add the members from map into result map.
5767 // 5767 //
5768 for (int j = 0; j < map.size; j++) { 5768 for (int j = 0; j < map.size; j++) {
5769 String key = map.getKey(j); 5769 String key = map.getKey(j);
5770 ExecutableElement value = map.getValue(j); 5770 ExecutableElement value = map.getValue(j);
5771 if (key != null) { 5771 if (key != null) {
5772 if (resultMap.get(key) == null || 5772 ClassElement definingClass = value
5773 (resultMap.get(key) != null && !_isAbstract(value))) { 5773 .getAncestor((Element element) => element is ClassElement);
5774 resultMap.put(key, value); 5774 if (!definingClass.type.isObject) {
5775 ExecutableElement existingValue = resultMap.get(key);
5776 if (existingValue == null ||
5777 (existingValue != null && !_isAbstract(value))) {
5778 resultMap.put(key, value);
5779 }
5775 } 5780 }
5776 } 5781 }
5777 } 5782 }
5778 } finally { 5783 } finally {
5779 visitedClasses.remove(mixinElement); 5784 visitedClasses.remove(mixinElement);
5780 } 5785 }
5781 } else { 5786 } else {
5782 // This case happens only when the superclass was previously visited 5787 // This case happens only when the superclass was previously visited
5783 // and not in the lookup, meaning this is meant to shorten the compute 5788 // and not in the lookup, meaning this is meant to shorten the compute
5784 // for recursive cases. 5789 // for recursive cases.
(...skipping 9442 matching lines...) Expand 10 before | Expand all | Expand 10 after
15227 nonFields.add(node); 15232 nonFields.add(node);
15228 return null; 15233 return null;
15229 } 15234 }
15230 15235
15231 @override 15236 @override
15232 Object visitNode(AstNode node) => node.accept(TypeResolverVisitor_this); 15237 Object visitNode(AstNode node) => node.accept(TypeResolverVisitor_this);
15233 15238
15234 @override 15239 @override
15235 Object visitWithClause(WithClause node) => null; 15240 Object visitWithClause(WithClause node) => null;
15236 } 15241 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/non_error_resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698