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

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

Issue 2850143002: Reuse RuntimeTypesNeedBuilderImpl and _RuntimeTypesNeed for kernel based elements (Closed)
Patch Set: Fix comment Created 3 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/compiler/lib/src/kernel/element_map.dart
diff --git a/pkg/compiler/lib/src/kernel/element_map.dart b/pkg/compiler/lib/src/kernel/element_map.dart
index 025838bb6b0f89d2866b8b14aa027487c1e65620..e06d3b3ab85338ccac615f072dbb6de6933518f8 100644
--- a/pkg/compiler/lib/src/kernel/element_map.dart
+++ b/pkg/compiler/lib/src/kernel/element_map.dart
@@ -424,6 +424,16 @@ class KernelToElementMap extends KernelElementAdapterMixin {
return env.rawType;
}
+ InterfaceType _asInstanceOf(InterfaceType type, KClass cls) {
+ OrderedTypeSet orderedTypeSet = _getOrderedTypeSet(type.element);
+ InterfaceType supertype =
+ orderedTypeSet.asInstanceOf(cls, _getHierarchyDepth(cls));
+ if (supertype != null) {
+ supertype = _substByContext(supertype, type);
+ }
+ return supertype;
+ }
+
void _ensureSupertypes(KClass cls, _KClassEnv env) {
if (env.orderedTypeSet == null) {
_ensureThisAndRawType(cls, env);
@@ -901,6 +911,11 @@ class KernelElementEnvironment implements ElementEnvironment {
}
@override
+ bool isGenericClass(ClassEntity cls) {
+ return getThisType(cls).typeArguments.isNotEmpty;
+ }
+
+ @override
DartType getTypeVariableBound(TypeVariableEntity typeVariable) {
throw new UnimplementedError(
'KernelElementEnvironment.getTypeVariableBound');

Powered by Google App Engine
This is Rietveld 408576698