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

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

Issue 10270010: Remove getType; use the resolver instead. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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: lib/compiler/implementation/resolver.dart
diff --git a/lib/compiler/implementation/resolver.dart b/lib/compiler/implementation/resolver.dart
index 5e949c3c19a02427004619e98c40b1ddcfd18e8d..23c2c837d0d9fce9140565213b98ebda542e73a5 100644
--- a/lib/compiler/implementation/resolver.dart
+++ b/lib/compiler/implementation/resolver.dart
@@ -211,6 +211,17 @@ class ResolverTask extends CompilerTask {
return visitor.mapping;
}
+ Type resolveType(Element element, TypeAnnotation annotation) {
+ if (annotation === null) return compiler.types.dynamicType;
+ ResolverVisitor visitor = new ResolverVisitor(compiler, element);
+ Type result = visitor.resolveTypeAnnotation(annotation);
+ if (result === null) {
+ // TODO(karklose): warning.
+ return compiler.types.dynamicType;
+ }
+ return result;
+ }
+
void resolveClass(ClassElement element) {
if (element.isResolved) return;
measure(() {
@@ -1107,9 +1118,12 @@ class ResolverVisitor extends CommonResolverVisitor<Element> {
}
type = new InterfaceType(cls.name, cls, arguments.toLink());
} else if (element.isTypedef()) {
- // TODO(karlklose): implement typedefs. We return a fake type that the
- // code generator can use to detect typedefs in is-checks.
- type = new InterfaceType(element.name, element);
+ // TODO(ngeoffray): This is a hack to help us get support for the
+ // DOM library.
+ // TODO(ngeoffray): The list of types for the argument is wrong.
+ type = new FunctionType(compiler.types.dynamicType,
+ const EmptyLink<Type>(),
+ element);
} else {
type = element.computeType(compiler);
}

Powered by Google App Engine
This is Rietveld 408576698