| Index: runtime/lib/mirrors_impl.dart
|
| diff --git a/runtime/lib/mirrors_impl.dart b/runtime/lib/mirrors_impl.dart
|
| index fe1c56ecdeb2726c023103dcfe542f93f8ab8668..f152adbc7334cffa00596224455530aecd15e020 100644
|
| --- a/runtime/lib/mirrors_impl.dart
|
| +++ b/runtime/lib/mirrors_impl.dart
|
| @@ -1645,6 +1645,8 @@ class _Mirrors {
|
| native "Mirrors_makeLocalClassMirror";
|
| static TypeMirror makeLocalTypeMirror(Type key)
|
| native "Mirrors_makeLocalTypeMirror";
|
| + static Type instantiateGenericType(Type key, typeArguments)
|
| + native "Mirrors_instantiateGenericType";
|
|
|
| static Expando<ClassMirror> _declarationCache = new Expando("ClassMirror");
|
| static Expando<TypeMirror> _instantiationCache = new Expando("TypeMirror");
|
| @@ -1661,7 +1663,10 @@ class _Mirrors {
|
| return classMirror;
|
| }
|
|
|
| - static TypeMirror reflectType(Type key) {
|
| + static TypeMirror reflectType(Type key, [List<Type> typeArguments]) {
|
| + if (typeArguments != null) {
|
| + key = _instantiateType(key, typeArguments);
|
| + }
|
| var typeMirror = _instantiationCache[key];
|
| if (typeMirror == null) {
|
| typeMirror = makeLocalTypeMirror(key);
|
| @@ -1672,4 +1677,12 @@ class _Mirrors {
|
| }
|
| return typeMirror;
|
| }
|
| +
|
| + static Type _instantiateType(Type key, List<Type> typeArguments) {
|
| + if (typeArguments.isEmpty) {
|
| + throw new ArgumentError.value(
|
| + typeArguments, 'typeArguments', 'Type arguments list cannot be empty.');
|
| + }
|
| + return instantiateGenericType(key, typeArguments.toList(growable: false));
|
| + }
|
| }
|
|
|