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

Unified Diff: dart/lib/compiler/implementation/elements/elements.dart

Issue 10575033: Implement override checks. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
Index: dart/lib/compiler/implementation/elements/elements.dart
diff --git a/dart/lib/compiler/implementation/elements/elements.dart b/dart/lib/compiler/implementation/elements/elements.dart
index db285be7446542d499059f2cc318fb3d2e1c4d9e..ef4e7c4443ed63b98697269702690d0e6dd97331 100644
--- a/dart/lib/compiler/implementation/elements/elements.dart
+++ b/dart/lib/compiler/implementation/elements/elements.dart
@@ -214,6 +214,8 @@ class Element implements Hashable {
bool _isNative = false;
void setNative() { _isNative = true; }
bool isNative() => _isNative;
+
+ FunctionElement asFunctionElement() => null;
}
class ContainerElement extends Element {
@@ -640,6 +642,8 @@ class FunctionElement extends Element {
Node parseNode(DiagnosticListener listener) => cachedNode;
Token position() => cachedNode.getBeginToken();
+
+ FunctionElement asFunctionElement() => this;
}
class ConstructorBodyElement extends FunctionElement {
@@ -754,11 +758,12 @@ class ClassElement extends ContainerElement {
Element lookupSuperMember(SourceString memberName) {
for (ClassElement s = superclass; s != null; s = s.superclass) {
Element e = s.lookupLocalMember(memberName);
- if (e !== null) {
- if (!memberName.isPrivate() || getLibrary() === e.getLibrary()) {
- return e;
- }
- }
+ if (e === null) continue;
+ // Private members from a different library are not visible.
+ if (memberName.isPrivate() && getLibrary() !== e.getLibrary()) continue;
+ // Static members are not inherited.
+ if (e.modifiers.isStatic()) continue;
+ return e;
}
return null;
}
« no previous file with comments | « no previous file | dart/lib/compiler/implementation/resolver.dart » ('j') | dart/lib/compiler/implementation/resolver.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698