When using the two capabilities typeAnnotationQuantifyCapability and superclassQuantifyCapability combined, the covered reflectable classes are not as expected.
Type annotations from super classes are reflectable, but super classes of type annotations are not. According to the code documentation, my expectation is, that in both cases all classes must be reflectable.
Consider the following Reflector:
class Reflector extends Reflectable {
const Reflector()
: super(instanceInvokeCapability, reflectedTypeCapability,
typeAnnotationQuantifyCapability, superclassQuantifyCapability);
}
const reflector = Reflector();
In the following case, the annotated class A extends a class B which has a class member of type C. In this case, all classes A, B and C are reflectable, which is what I expect.
@reflector
class A extends B { }
class B {
C? c;
}
class C {}
The second case is the other way around, the annotated class A has a member of type B which extends class C. In this case, only class A and B are reflectable.
@reflector
class A {
B? b;
}
class B extends C {}
class C {}
My expectation is that class C must be reflectable as well, since the doc of superclassQuantifyCapability is:
Gives support for reflection on all superclasses of covered classes.
When using the two capabilities
typeAnnotationQuantifyCapabilityandsuperclassQuantifyCapabilitycombined, the covered reflectable classes are not as expected.Type annotations from super classes are reflectable, but super classes of type annotations are not. According to the code documentation, my expectation is, that in both cases all classes must be reflectable.
Consider the following Reflector:
In the following case, the annotated class
Aextends a classBwhich has a class member of typeC. In this case, all classesA,BandCare reflectable, which is what I expect.The second case is the other way around, the annotated class
Ahas a member of typeBwhich extends classC. In this case, only classAandBare reflectable.My expectation is that class
Cmust be reflectable as well, since the doc ofsuperclassQuantifyCapabilityis: