| Index: runtime/lib/mirrors.cc
|
| diff --git a/runtime/lib/mirrors.cc b/runtime/lib/mirrors.cc
|
| index 8e71843f3658c413e8296de0b1773510289887db..d5c08cea4d798790261ca849c0597afa92ec0149 100644
|
| --- a/runtime/lib/mirrors.cc
|
| +++ b/runtime/lib/mirrors.cc
|
| @@ -1410,11 +1410,31 @@ DEFINE_NATIVE_ENTRY(ClassMirror_invokeConstructor, 5) {
|
| UNREACHABLE();
|
| }
|
|
|
| + ASSERT(!type.IsNull());
|
| + AbstractTypeArguments& type_arguments =
|
| + AbstractTypeArguments::Handle(type.arguments());
|
| +
|
| Class& redirected_klass = Class::Handle(klass.raw());
|
| Function& redirected_constructor = Function::Handle(lookup_constructor.raw());
|
| if (lookup_constructor.IsRedirectingFactory()) {
|
| ClassFinalizer::ResolveRedirectingFactory(klass, lookup_constructor);
|
| - Type& type = Type::Handle(lookup_constructor.RedirectionType());
|
| + Type& redirect_type = Type::Handle(lookup_constructor.RedirectionType());
|
| +
|
| + if (!redirect_type.IsInstantiated()) {
|
| + // The type arguments of the redirection type are instantiated from the
|
| + // type arguments of the type reflected by the class mirror.
|
| + Error& malformed_error = Error::Handle();
|
| + redirect_type ^= redirect_type.InstantiateFrom(type_arguments,
|
| + &malformed_error);
|
| + if (!malformed_error.IsNull()) {
|
| + ThrowInvokeError(malformed_error);
|
| + UNREACHABLE();
|
| + }
|
| + }
|
| +
|
| + type = redirect_type.raw();
|
| + type_arguments = redirect_type.arguments();
|
| +
|
| redirected_constructor = lookup_constructor.RedirectionTarget();
|
| ASSERT(!redirected_constructor.IsNull());
|
| redirected_klass = type.type_class();
|
| @@ -1451,10 +1471,6 @@ DEFINE_NATIVE_ENTRY(ClassMirror_invokeConstructor, 5) {
|
| UNREACHABLE();
|
| }
|
|
|
| - ASSERT(!type.IsNull());
|
| - const AbstractTypeArguments& type_arguments =
|
| - AbstractTypeArguments::Handle(type.arguments());
|
| -
|
| Instance& new_object = Instance::Handle();
|
| if (redirected_constructor.IsConstructor()) {
|
| // Constructors get the uninitialized object and a constructor phase. Note
|
|
|