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

Unified Diff: pkg/fletchc/lib/src/fletch_constants.dart

Issue 1059573004: Compile tearoffs of static functions as constants. (Closed) Base URL: git@github.com:dart-lang/fletch.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
Index: pkg/fletchc/lib/src/fletch_constants.dart
diff --git a/pkg/fletchc/lib/src/fletch_constants.dart b/pkg/fletchc/lib/src/fletch_constants.dart
index d6744a9a232d36db210ab69ffb14d7aa7ae5d982..9e183ef7e4338c2a4ccd362bbec97cd397b688d8 100644
--- a/pkg/fletchc/lib/src/fletch_constants.dart
+++ b/pkg/fletchc/lib/src/fletch_constants.dart
@@ -60,3 +60,23 @@ class FletchClassConstant extends ConstantValue {
return 'FletchClassConstant($classId)';
}
}
+
+class FletchClassInstanceConstant extends ConstantValue {
ahe 2015/04/07 15:00:11 Why is this needed?
Anders Johnsen 2015/04/08 06:32:14 Because we create artificial constants, not presen
+ final int classId;
+
+ FletchClassInstanceConstant(this.classId);
+
+ DartType getType(CoreTypes types) => const DynamicType();
+
+ List<ConstantValue> getDependencies() => const <ConstantValue>[];
+
+ accept(visitor, arg) {
+ throw new UnsupportedError("FletchClassInstanceConstant.accept");
+ }
+
+ String unparse() => toStructuredString();
+
+ String toStructuredString() {
+ return 'FletchClassInstanceConstant($classId)';
+ }
+}
« pkg/fletchc/lib/src/codegen_visitor.dart ('K') | « pkg/fletchc/lib/src/fletch_backend.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698