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

Unified Diff: lib/kernel_visitor.dart

Issue 2087503002: Getting enums for free. (Closed) Base URL: git@github.com:dart-lang/rasta.git@prune_unsupported
Patch Set: Created 4 years, 6 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 | « no previous file | test/kernel/regression/enum.dart » ('j') | test/kernel/regression/enum.dart.txt » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/kernel_visitor.dart
diff --git a/lib/kernel_visitor.dart b/lib/kernel_visitor.dart
index 4b9049f20c8cbe5b3601c02ad62f5303d8ff4811..2b6c00b13d79cc8680cdaa992821e291c6cbac1b 100644
--- a/lib/kernel_visitor.dart
+++ b/lib/kernel_visitor.dart
@@ -766,8 +766,12 @@ class KernelVisitor extends Object
}
@override
- ir.Throw visitEnum(Enum node) {
- return buildUnsupported(node, "Enum");
+ visitEnum(Enum node) {
+ // Not called normally. In dart2js, enums are represented as class
+ // elements, so `classToIr` handles enums. All the synthetic members of an
+ // enum class have already been installed by dart2js and we don't have to
+ // do anything special.
+ return internalError(node, "Enum");
}
@override
« no previous file with comments | « no previous file | test/kernel/regression/enum.dart » ('j') | test/kernel/regression/enum.dart.txt » ('J')

Powered by Google App Engine
This is Rietveld 408576698