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

Unified Diff: pkg/compiler/lib/src/compiler.dart

Issue 2609063002: Further reduce use of Element in codegen. (Closed)
Patch Set: Created 3 years, 12 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/compiler/lib/src/compiler.dart
diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart
index 9670004de3495b9d97bbcbbc26218d6c84964481..a48bef41e19dac00e3194113c9a85d4f0fbfc94b 100644
--- a/pkg/compiler/lib/src/compiler.dart
+++ b/pkg/compiler/lib/src/compiler.dart
@@ -1474,6 +1474,18 @@ class _CompilerCommonElements implements CommonElements {
ConstructorElement _filledListConstructor;
ConstructorElement get filledListConstructor =>
_filledListConstructor ??= listClass.lookupConstructor("filled");
+
+ // TODO(johnniwinther): Change types to `ClassElement` when these are not
+ // called with unrelated elements.
+ bool isNumberOrStringSupertype(/*Class*/ Element element) {
+ return element == coreLibrary.find('Comparable');
+ }
+
+ bool isStringOnlySupertype(/*Class*/ Element element) {
+ return element == coreLibrary.find('Pattern');
+ }
+
+ bool isListSupertype(/*Class*/ Element element) => element == iterableClass;
}
class CompilerDiagnosticReporter extends DiagnosticReporter {

Powered by Google App Engine
This is Rietveld 408576698