Chromium Code Reviews| Index: pkg/compiler/lib/src/kernel/element_map_impl.dart |
| diff --git a/pkg/compiler/lib/src/kernel/element_map_impl.dart b/pkg/compiler/lib/src/kernel/element_map_impl.dart |
| index a8ac5a068cd334aef4d022906f9140cbd3f6e837..d64b63256cc4edce4bf5a2f816f6d220bf9a870a 100644 |
| --- a/pkg/compiler/lib/src/kernel/element_map_impl.dart |
| +++ b/pkg/compiler/lib/src/kernel/element_map_impl.dart |
| @@ -253,6 +253,11 @@ abstract class KernelToElementMapBase extends KernelToElementMapBaseMixin { |
| } |
| } |
| + List<DartType> getTypeVariables(ir.Class cls) { |
| + return cls.typeParameters |
| + .map((ir.TypeParameter type) => getDartType(type.bound)); |
|
Johnni Winther
2017/09/04 06:59:56
This is not the correct implementation.
class C<T
Emily Fortuna
2017/09/05 17:13:31
Done.
|
| + } |
| + |
| TypeVariableEntity getTypeVariable(ir.TypeParameter node) => |
| _getTypeVariable(node); |
| @@ -1274,6 +1279,16 @@ class KernelElementEnvironment implements ElementEnvironment { |
| return elementMap._getFieldType(field); |
| } |
| + List<DartType> getTypeVariables(ClassEntity cls) { |
| + ir.Class irClass = elementMap._classes.getEnv(cls).cls; |
| + // Not all entities have corresponding ir.Nodes, but those that do not are |
| + // synthetic elements like closure classes, which don't have specialized |
| + // type variables. |
| + return irClass == null |
| + ? const <DartType>[] |
| + : elementMap.getTypeVariables(irClass); |
|
Johnni Winther
2017/09/04 06:59:56
This method can be implemented using the current i
Emily Fortuna
2017/09/05 17:13:31
Done.
|
| + } |
| + |
| @override |
| FunctionType getLocalFunctionType(covariant KLocalFunction function) { |
| return function.functionType; |