| Index: pkg/serialization/lib/src/serialization_rule.dart
|
| diff --git a/pkg/serialization/lib/src/serialization_rule.dart b/pkg/serialization/lib/src/serialization_rule.dart
|
| index 49e42ae7885db2724f4bb509a7f85c5a81af7a65..d5853215a9f9466567ec26a7f88fdf4e534ea6b6 100644
|
| --- a/pkg/serialization/lib/src/serialization_rule.dart
|
| +++ b/pkg/serialization/lib/src/serialization_rule.dart
|
| @@ -410,13 +410,18 @@ class MirrorRule extends NamedObjectRule {
|
| if (name.contains(":")) {
|
| var uri = Uri.parse(name);
|
| var libMirror = currentMirrorSystem().libraries[uri];
|
| - return libMirror.classes[new Symbol(type)];
|
| + var result = libMirror.declarations[new Symbol(type)];
|
| + return result is ClassMirror ? result : null;
|
| } else {
|
| var symbol = new Symbol(name);
|
| var typeSymbol = new Symbol(type);
|
| - var libMirror = currentMirrorSystem().libraries.values.firstWhere(
|
| - (lib) => lib.simpleName == symbol && lib.classes[typeSymbol] != null);
|
| - return libMirror.classes[typeSymbol];
|
| + var libMirror = currentMirrorSystem().libraries.values.firstWhere((lib) {
|
| + if (lib.simpleName != symbol) return false;
|
| + var candidate = lib.declarations[typeSymbol];
|
| + return candidate != null && candidate is ClassMirror;
|
| + });
|
| + var result = libMirror.declarations[typeSymbol];
|
| + return result is ClassMirror ? result : null;
|
| }
|
| }
|
| }
|
|
|