Chromium Code Reviews| 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; |
|
ahe
2012/04/12 15:05:23
I'd prefer getting the original to work.
|
| 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; |