From 44fb7ab881f2013979faf1b6db1c723324d0b1a4 Mon Sep 17 00:00:00 2001 From: Patrick Stewart Date: Sat, 21 Dec 2024 10:06:39 -0700 Subject: [PATCH] refactor: refactored reflection to be more like dart:mirrors test pass --- incubation/reflection/lib/src/mirrors/mirror_system.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/incubation/reflection/lib/src/mirrors/mirror_system.dart b/incubation/reflection/lib/src/mirrors/mirror_system.dart index 787c789..d5198f1 100644 --- a/incubation/reflection/lib/src/mirrors/mirror_system.dart +++ b/incubation/reflection/lib/src/mirrors/mirror_system.dart @@ -261,6 +261,9 @@ class MirrorSystem implements MirrorSystemContract { @override TypeMirrorContract reflectType(Type type) { + if (!Reflector.isReflectable(type)) { + throw ArgumentError('Type is not reflectable: $type'); + } return _getOrCreateTypeMirror(type); }