File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -272,8 +272,13 @@ class ReflectionCapabilities implements PlatformReflectionCapabilities {
272272 }
273273
274274 List interfaces (type) {
275- ClassMirror classMirror = reflectType (type);
276- return classMirror.superinterfaces.map ((si) => si.reflectedType).toList ();
275+ return _interfacesFromMirror (reflectType (type));
276+ }
277+
278+ List _interfacesFromMirror (classMirror) {
279+ return classMirror.superinterfaces.map ((si) => si.reflectedType).toList ()
280+ ..addAll (classMirror.superclass == null ? []
281+ : _interfacesFromMirror (classMirror.superclass));
277282 }
278283
279284 GetterFn getter (String name) {
Original file line number Diff line number Diff line change @@ -51,7 +51,11 @@ class TestObj {
5151
5252class Interface { }
5353
54- class ClassImplementingInterface implements Interface { }
54+ class Interface2 { }
55+
56+ class SuperClassImplementingInterface implements Interface2 { }
57+
58+ class ClassImplementingInterface extends SuperClassImplementingInterface implements Interface { }
5559
5660export function main ( ) {
5761 describe ( 'Reflector' , ( ) => {
@@ -191,7 +195,7 @@ export function main() {
191195 describe ( "interfaces" , ( ) => {
192196 it ( "should return an array of interfaces for a type" , ( ) => {
193197 var p = reflector . interfaces ( ClassImplementingInterface ) ;
194- expect ( p ) . toEqual ( [ Interface ] ) ;
198+ expect ( p ) . toEqual ( [ Interface , Interface2 ] ) ;
195199 } ) ;
196200
197201 it ( "should return an empty array otherwise" , ( ) => {
You can’t perform that action at this time.
0 commit comments