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

Side by Side Diff: frog/leg/resolver.dart

Issue 9419048: Resolve class element of Object, even if no objects are used. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | frog/leg/ssa/builder.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 interface TreeElements { 5 interface TreeElements {
6 Element operator[](Node node); 6 Element operator[](Node node);
7 Selector getSelector(Send send); 7 Selector getSelector(Send send);
8 } 8 }
9 9
10 class TreeElementMapping implements TreeElements { 10 class TreeElementMapping implements TreeElements {
(...skipping 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after
1018 compiler.ensure(element !== null); 1018 compiler.ensure(element !== null);
1019 compiler.ensure(!element.isResolved); 1019 compiler.ensure(!element.isResolved);
1020 element.supertype = visit(node.superclass); 1020 element.supertype = visit(node.superclass);
1021 if (element.name != Types.OBJECT && element.supertype === null) { 1021 if (element.name != Types.OBJECT && element.supertype === null) {
1022 ClassElement objectElement = context.lookup(Types.OBJECT); 1022 ClassElement objectElement = context.lookup(Types.OBJECT);
1023 if (objectElement !== null && !objectElement.isResolved) { 1023 if (objectElement !== null && !objectElement.isResolved) {
1024 compiler.resolver.toResolve.add(objectElement); 1024 compiler.resolver.toResolve.add(objectElement);
1025 } else if (objectElement === null){ 1025 } else if (objectElement === null){
1026 error(node, MessageKind.CANNOT_RESOLVE_TYPE, [Types.OBJECT]); 1026 error(node, MessageKind.CANNOT_RESOLVE_TYPE, [Types.OBJECT]);
1027 } 1027 }
1028 element.supertype = new SimpleType(Types.OBJECT, 1028 element.supertype = new SimpleType(Types.OBJECT, objectElement);
1029 objectElement);
1030 } 1029 }
1031 if (node.defaultClause !== null) { 1030 if (node.defaultClause !== null) {
1032 element.defaultClass = visit(node.defaultClause.nodes.head); 1031 element.defaultClass = visit(node.defaultClause.nodes.head);
1033 } 1032 }
1034 for (Link<Node> link = node.interfaces.nodes; 1033 for (Link<Node> link = node.interfaces.nodes;
1035 !link.isEmpty(); 1034 !link.isEmpty();
1036 link = link.tail) { 1035 link = link.tail) {
1037 element.interfaces = element.interfaces.prepend(visit(link.head)); 1036 element.interfaces = element.interfaces.prepend(visit(link.head));
1038 } 1037 }
1039 return element.computeType(compiler); 1038 return element.computeType(compiler);
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
1292 class TopScope extends Scope { 1291 class TopScope extends Scope {
1293 LibraryElement get library() => element; 1292 LibraryElement get library() => element;
1294 1293
1295 TopScope(LibraryElement library) : super(null, library); 1294 TopScope(LibraryElement library) : super(null, library);
1296 Element lookup(SourceString name) => library.find(name); 1295 Element lookup(SourceString name) => library.find(name);
1297 1296
1298 Element add(Element element) { 1297 Element add(Element element) {
1299 throw "Cannot add an element in the top scope"; 1298 throw "Cannot add an element in the top scope";
1300 } 1299 }
1301 } 1300 }
OLDNEW
« no previous file with comments | « no previous file | frog/leg/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698