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

Side by Side Diff: pkg/compiler/lib/src/kernel/element_map_impl.dart

Issue 2987233002: Implement hasConcreteMatch (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | 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) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 dart2js.kernel.element_map; 5 library dart2js.kernel.element_map;
6 6
7 import 'package:kernel/ast.dart' as ir; 7 import 'package:kernel/ast.dart' as ir;
8 8
9 import '../common.dart'; 9 import '../common.dart';
10 import '../common/names.dart' show Identifiers; 10 import '../common/names.dart' show Identifiers;
(...skipping 1552 matching lines...) Expand 10 before | Expand all | Expand 10 after
1563 return member == element; 1563 return member == element;
1564 } 1564 }
1565 cls = elementEnvironment.getSuperClass(cls); 1565 cls = elementEnvironment.getSuperClass(cls);
1566 } 1566 }
1567 return false; 1567 return false;
1568 } 1568 }
1569 1569
1570 @override 1570 @override
1571 bool hasConcreteMatch(ClassEntity cls, Selector selector, 1571 bool hasConcreteMatch(ClassEntity cls, Selector selector,
1572 {ClassEntity stopAtSuperclass}) { 1572 {ClassEntity stopAtSuperclass}) {
1573 throw new UnimplementedError('KernelClosedWorldMixin.hasConcreteMatch'); 1573 assert(
1574 isInstantiated(cls), failedAt(cls, '$cls has not been instantiated.'));
1575 MemberEntity element = elementEnvironment
1576 .lookupClassMember(cls, selector.name, setter: selector.isSetter);
1577 if (element == null) return false;
1578
1579 if (element.isAbstract) {
1580 ClassEntity enclosingClass = element.enclosingClass;
1581 return hasConcreteMatch(
1582 elementEnvironment.getSuperClass(enclosingClass), selector);
1583 }
1584 return selector.appliesUntyped(element);
1574 } 1585 }
1575 1586
1576 @override 1587 @override
1577 bool isNamedMixinApplication(ClassEntity cls) { 1588 bool isNamedMixinApplication(ClassEntity cls) {
1578 throw new UnimplementedError( 1589 throw new UnimplementedError(
1579 'KernelClosedWorldMixin.isNamedMixinApplication'); 1590 'KernelClosedWorldMixin.isNamedMixinApplication');
1580 } 1591 }
1581 1592
1582 @override 1593 @override
1583 ClassEntity getAppliedMixin(ClassEntity cls) { 1594 ClassEntity getAppliedMixin(ClassEntity cls) {
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
2116 /// 2127 ///
2117 /// These names are not used in generated code, just as element name. 2128 /// These names are not used in generated code, just as element name.
2118 String _getClosureVariableName(String name, int id) { 2129 String _getClosureVariableName(String name, int id) {
2119 return "_captured_${name}_$id"; 2130 return "_captured_${name}_$id";
2120 } 2131 }
2121 2132
2122 String getDeferredUri(ir.LibraryDependency node) { 2133 String getDeferredUri(ir.LibraryDependency node) {
2123 throw new UnimplementedError('JsKernelToElementMap.getDeferredUri'); 2134 throw new UnimplementedError('JsKernelToElementMap.getDeferredUri');
2124 } 2135 }
2125 } 2136 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698