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

Unified Diff: frog/value.dart

Issue 8481023: cleanup errors and fix a couple field negative tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « frog/type.dart ('k') | frog/world.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/value.dart
diff --git a/frog/value.dart b/frog/value.dart
index e838195a08d0a2cbeef70217d70265a650d1712a..bb5ff4ce54ef2c3ecc63d4f970173e077ef6ba76 100644
--- a/frog/value.dart
+++ b/frog/value.dart
@@ -109,6 +109,7 @@ class Value {
return member != null && member.canInvoke(context, args);
}
+ // TODO(jimhug): Better type here - currently is union(Member, MemberSet)
_tryResolveMember(MethodGenerator context, String name) {
var member = null;
if (!type.isVar) {
@@ -118,6 +119,7 @@ class Value {
member = type.resolveMember(name);
}
}
+
if (member == null) {
// TODO(jmesserly): shouldn't look in world except for "var"
member = context.findMembers(name);
@@ -127,7 +129,12 @@ class Value {
_resolveMember(MethodGenerator context, String name, Node node) {
var member = _tryResolveMember(context, name);
- if (member == null) {
+ if (member != null) {
+ if (isType && !member.isStatic) {
+ world.error('can not refer to instance member as static', node.span);
+ }
+ return member;
+ } else {
// TODO(jmesserly): we suppress warnings if someone has overridden
// noSuchMethod, and we know it will call their version. Is that right?
if (_tryResolveMember(context, 'noSuchMethod').members.length > 1) {
@@ -145,8 +152,8 @@ class Value {
if (context.findMembers(name) == null) {
world.warning('$name is not defined anywhere in the world.', node.span);
}
+ return null;
}
- return member;
}
checkFirstClass(SourceSpan span) {
« no previous file with comments | « frog/type.dart ('k') | frog/world.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698