| Index: third_party/pkg/di/lib/dynamic_injector.dart
|
| diff --git a/third_party/pkg/di/lib/dynamic_injector.dart b/third_party/pkg/di/lib/dynamic_injector.dart
|
| index 53ec52eec24922f63e40abf464ef30920fbbc416..46c782e8e2acfde6fc9d964c9145fd0b6de24088 100644
|
| --- a/third_party/pkg/di/lib/dynamic_injector.dart
|
| +++ b/third_party/pkg/di/lib/dynamic_injector.dart
|
| @@ -30,8 +30,23 @@ class DynamicInjector extends Injector {
|
|
|
| MethodMirror ctor = classMirror.declarations[classMirror.simpleName];
|
|
|
| + if (ctor == null) {
|
| + throw new NoProviderError('Unable to find default constructor for $type. '
|
| + 'Make sure class has a default constructor.' +
|
| + (1.0 is int ?
|
| + ' Make sure you have correctly configured @MirrorsUsed.' : ''));
|
| + }
|
| +
|
| resolveArgument(int pos) {
|
| ParameterMirror p = ctor.parameters[pos];
|
| + if (MirrorSystem.getName(p.type.qualifiedName) == 'dynamic') {
|
| + var name = MirrorSystem.getName(p.simpleName);
|
| + throw new NoProviderError(error("The '$name' parameter must be typed"));
|
| + }
|
| + if (p.type is TypedefMirror) {
|
| + throw new NoProviderError(
|
| + error('Cannot create new instance of a typedef ${p.type}'));
|
| + }
|
| return getInstanceByType(getReflectedTypeWorkaround(p.type), requestor);
|
| }
|
|
|
|
|