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

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

Issue 10095014: Implement interface types. (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
« no previous file with comments | « frog/tests/leg/src/ResolverTest.dart ('k') | lib/compiler/implementation/resolver.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/compiler.dart
diff --git a/lib/compiler/implementation/compiler.dart b/lib/compiler/implementation/compiler.dart
index 0e68c7d10193a893b23b85f71cab83b2cfa2d320..ab339998db479527b8db047bf157f6b2e27f8758 100644
--- a/lib/compiler/implementation/compiler.dart
+++ b/lib/compiler/implementation/compiler.dart
@@ -35,7 +35,7 @@ class Compiler implements DiagnosticListener {
Universe universe;
String assembledCode;
Namer namer;
- Types types;
+ final Types types;
final Tracer tracer;
@@ -222,7 +222,7 @@ class Compiler implements DiagnosticListener {
functionClass = coreLibrary.find(const SourceString('Function'));
listClass = coreLibrary.find(const SourceString('List'));
closureClass = jsHelperLibrary.find(const SourceString('Closure'));
- dynamicClass = jsHelperLibrary.find(const SourceString('Dynamic'));
+ dynamicClass = types.dynamicType.element;
nullClass = jsHelperLibrary.find(const SourceString('Null'));
}
@@ -266,14 +266,15 @@ class Compiler implements DiagnosticListener {
void runCompiler(Uri uri) {
scanBuiltinLibraries();
mainApp = scanner.loadLibrary(uri, null);
- final Element mainMethod = mainApp.find(MAIN);
- if (mainMethod === null) {
+ final Element mainElement = mainApp.find(MAIN);
+ if (mainElement === null) {
withCurrentElement(mainApp, () => cancel('Could not find $MAIN'));
} else {
- withCurrentElement(mainMethod, () {
- if (!mainMethod.isFunction()) {
- cancel('main is not a function', element: mainMethod);
+ withCurrentElement(mainElement, () {
+ if (!mainElement.isFunction()) {
+ cancel('main is not a function', element: mainElement);
}
+ FunctionElement mainMethod = mainElement;
FunctionParameters parameters = mainMethod.computeParameters(this);
if (parameters.parameterCount > 0) {
cancel('main cannot have parameters', element: mainMethod);
@@ -281,7 +282,7 @@ class Compiler implements DiagnosticListener {
});
}
native.processNativeClasses(this, universe.libraries.getValues());
- enqueue(new WorkItem.toCompile(mainMethod));
+ enqueue(new WorkItem.toCompile(mainElement));
codegenProgress.reset();
while (!worklist.isEmpty()) {
WorkItem work = worklist.removeLast();
@@ -406,10 +407,7 @@ class Compiler implements DiagnosticListener {
}
reportWarning(Node node, var message) {
- if (message is ResolutionWarning) {
- // TODO(ahe): Don't supress this warning when we support type variables.
- if (message.message.kind === MessageKind.CANNOT_RESOLVE_TYPE) return;
- } else if (message is TypeWarning) {
+ if (message is TypeWarning) {
// TODO(ahe): Don't supress these warning when the type checker
// is more complete.
if (message.message.kind === MessageKind.NOT_ASSIGNABLE) return;
« no previous file with comments | « frog/tests/leg/src/ResolverTest.dart ('k') | lib/compiler/implementation/resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698