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

Unified Diff: frog/leg/resolver.dart

Issue 9618053: Introduce the TYPEDEF element, and use it in order to catch passing closures to the DOM. I make the… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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: frog/leg/resolver.dart
===================================================================
--- frog/leg/resolver.dart (revision 5070)
+++ frog/leg/resolver.dart (working copy)
@@ -611,15 +611,18 @@
} else {
warning(node, MessageKind.CANNOT_RESOLVE_TYPE, [className]);
}
- } else if (element.kind !== ElementKind.CLASS) {
+ } else if (!element.isClassOrInterfaceOrAlias()) {
if (typeRequired) {
error(node, MessageKind.NOT_A_TYPE, [className]);
} else {
warning(node, MessageKind.NOT_A_TYPE, [className]);
}
} else {
- ClassElement cls = element;
- compiler.resolver.toResolve.add(element);
+ if (element.isClass()) {
+ // TODO(ngeoffray): Should we also resolve typedef?
+ ClassElement cls = element;
+ compiler.resolver.toResolve.add(element);
+ }
// TODO(ahe): This should be a Type.
useElement(node, element);
}
@@ -1231,7 +1234,7 @@
Element element = context.lookup(node.source);
if (element === null) {
error(node, MessageKind.CANNOT_RESOLVE_TYPE, [node]);
- } else if (element.kind !== ElementKind.CLASS) {
+ } else if (!element.isClassOrInterfaceOrAlias()) {
error(node, MessageKind.NOT_A_TYPE, [node]);
} else {
compiler.resolver.toResolve.add(element);

Powered by Google App Engine
This is Rietveld 408576698