Reflection small feature request (mark?)

Monkey Forums/Monkey Programming/Reflection small feature request (mark?)

ziggy(Posted 2014) [#1]
I'll try to explain the issue as simiply as possible:

Scenario:
1.- I enable reflection on a module that has a class I want to reflect
2.- This class extends another class defined elsewhere, and this other class is not reflected

Result:
My class is not reflected, so I have to include the external module too in the reflection filter and I end with enormous quantities of generated code I don't need or call.

Proposal:
That when you reflect a module, it reflects its classes as expected and, if a class inherits functionality from another class that is not reflected, this functionality could just be ignored. In the end, the reflection filter coud focus on what's explicitly reflected. If my class implements several methods, and defines functions, etc, those should be reflected. Also if it overrides any function from its non reflected superclass, this should be reflected too. It is understandable that members of the class that are only defined in the non reflected superclass, can be ignored from the filter.

This would allow us to make a more restrictive usage of reflection, and help resolving large compilation times. It would also help us reducing the amounts of generated code making apps that use reflection smaller.

Would love to know your tohughts, and if there's any technical reason not to do it like this?


marksibly(Posted 2014) [#2]
I'll have a look into this - sounds sensible, but there may be a reason why things are the way they are...


ziggy(Posted 2014) [#3]
Thanks for the answer Mark. I would appreciate it a lot if you can find the time to take a look to my suggestion