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

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: Address review comments. 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
« no previous file with comments | « frog/tests/leg/type_checker_test.dart ('k') | lib/compiler/implementation/typechecker.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..28253596e10a827faec62662f604744b75bb168b 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);
+ Type computeType(compiler) => compiler.types.voidType;
+ Node parseNode(_) {
+ throw 'internal error: parseNode on void';
+ }
+ bool impliesType() => true;
+}
+
class ClassElement extends ContainerElement {
Type type;
Type supertype;
« no previous file with comments | « frog/tests/leg/type_checker_test.dart ('k') | lib/compiler/implementation/typechecker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698