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

Side by Side Diff: lib/compiler/implementation/resolver.dart

Issue 10105027: Remove SimpleType. (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 unified diff | Download patch | Annotate | Revision Log
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 Type getType(TypeAnnotation annotation); 8 Type getType(TypeAnnotation annotation);
9 } 9 }
10 10
(...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1111 for (Link<Node> typeArguments = node.typeArguments.nodes; 1111 for (Link<Node> typeArguments = node.typeArguments.nodes;
1112 !typeArguments.isEmpty(); 1112 !typeArguments.isEmpty();
1113 typeArguments = typeArguments.tail) { 1113 typeArguments = typeArguments.tail) {
1114 arguments.addLast(resolveTypeAnnotation(typeArguments.head)); 1114 arguments.addLast(resolveTypeAnnotation(typeArguments.head));
1115 } 1115 }
1116 } 1116 }
1117 type = new InterfaceType(element.name, element, arguments.toLink()); 1117 type = new InterfaceType(element.name, element, arguments.toLink());
1118 } else if (element.isTypedef()) { 1118 } else if (element.isTypedef()) {
1119 // TODO(karlklose): implement typedefs. We return a fake type that the 1119 // TODO(karlklose): implement typedefs. We return a fake type that the
1120 // code generator can use to detect typedefs in is-checks. 1120 // code generator can use to detect typedefs in is-checks.
1121 type = new SimpleType(element.name, element); 1121 type = new InterfaceType(element.name, element);
1122 } else { 1122 } else {
1123 type = element.computeType(compiler); 1123 type = element.computeType(compiler);
1124 } 1124 }
1125 } 1125 }
1126 return useType(node, type); 1126 return useType(node, type);
1127 } 1127 }
1128 1128
1129 visitModifiers(Modifiers node) { 1129 visitModifiers(Modifiers node) {
1130 // TODO(ngeoffray): Implement this. 1130 // TODO(ngeoffray): Implement this.
1131 unimplemented(node, 'modifiers'); 1131 unimplemented(node, 'modifiers');
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
1406 } else if (supertype !== null) { 1406 } else if (supertype !== null) {
1407 error(node.superclass, MessageKind.TYPE_NAME_EXPECTED); 1407 error(node.superclass, MessageKind.TYPE_NAME_EXPECTED);
1408 } 1408 }
1409 if (classElement.name != Types.OBJECT && classElement.supertype === null) { 1409 if (classElement.name != Types.OBJECT && classElement.supertype === null) {
1410 ClassElement objectElement = context.lookup(Types.OBJECT); 1410 ClassElement objectElement = context.lookup(Types.OBJECT);
1411 if (objectElement !== null && !objectElement.isResolved) { 1411 if (objectElement !== null && !objectElement.isResolved) {
1412 compiler.resolver.toResolve.add(objectElement); 1412 compiler.resolver.toResolve.add(objectElement);
1413 } else if (objectElement === null){ 1413 } else if (objectElement === null){
1414 error(node, MessageKind.CANNOT_RESOLVE_TYPE, [Types.OBJECT]); 1414 error(node, MessageKind.CANNOT_RESOLVE_TYPE, [Types.OBJECT]);
1415 } 1415 }
1416 classElement.supertype = new SimpleType(Types.OBJECT, objectElement); 1416 classElement.supertype = new InterfaceType(Types.OBJECT, objectElement);
1417 } 1417 }
1418 if (node.defaultClause !== null) { 1418 if (node.defaultClause !== null) {
1419 classElement.defaultClass = visit(node.defaultClause); 1419 classElement.defaultClass = visit(node.defaultClause);
1420 } 1420 }
1421 for (Link<Node> link = node.interfaces.nodes; 1421 for (Link<Node> link = node.interfaces.nodes;
1422 !link.isEmpty(); 1422 !link.isEmpty();
1423 link = link.tail) { 1423 link = link.tail) {
1424 Type interfaceType = visit(link.head); 1424 Type interfaceType = visit(link.head);
1425 if (interfaceType !== null && interfaceType.element.isExtendable()) { 1425 if (interfaceType !== null && interfaceType.element.isExtendable()) {
1426 classElement.interfaces = 1426 classElement.interfaces =
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
1919 1919
1920 TopScope(LibraryElement library) : super(null, library); 1920 TopScope(LibraryElement library) : super(null, library);
1921 Element lookup(SourceString name) { 1921 Element lookup(SourceString name) {
1922 return library.find(name); 1922 return library.find(name);
1923 } 1923 }
1924 1924
1925 Element add(Element element) { 1925 Element add(Element element) {
1926 throw "Cannot add an element in the top scope"; 1926 throw "Cannot add an element in the top scope";
1927 } 1927 }
1928 } 1928 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/elements/elements.dart ('k') | lib/compiler/implementation/typechecker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698