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

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

Issue 10387033: Add VoidElement and VoidType to make sure that there is a canonical void type. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 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/elements/elements.dart
diff --git a/lib/compiler/implementation/elements/elements.dart b/lib/compiler/implementation/elements/elements.dart
index 95109ae759d0d399ec0d084b6f43c0b437120f99..3ea8bfbcef6d471afc2e28aad09cfa519d7e4ecf 100644
--- a/lib/compiler/implementation/elements/elements.dart
+++ b/lib/compiler/implementation/elements/elements.dart
@@ -92,6 +92,8 @@ class ElementKind {
const ElementKind('statement', ElementCategory.NONE);
static final ElementKind LABEL =
const ElementKind('label', ElementCategory.NONE);
+ static final ElementKind VOID =
+ const ElementKind('void', ElementCategory.NONE);
toString() => id;
}
@@ -664,6 +666,16 @@ class SynthesizedConstructorElement extends FunctionElement {
Token position() => enclosingElement.position();
}
+class VoidElement extends Element {
+ VoidElement(Element enclosing)
+ : super(Types.VOID, ElementKind.VOID, enclosing);
ngeoffray 2012/05/09 08:54:40 Please add return types to the methods below.
karlklose 2012/05/09 10:32:41 Done.
+ computeType(compiler) => compiler.types.voidType;
+ parseNode(_) {
+ throw 'internal error: parseNode on void';
+ }
+ impliesType() => true;
+}
+
class ClassElement extends ContainerElement {
Type type;
Type supertype;

Powered by Google App Engine
This is Rietveld 408576698