Error using Reflection due to the filter

Monkey Forums/Monkey Beginners/Error using Reflection due to the filter

PhillipK(Posted 2014) [#1]
Heyho,

i have some bad problems using reflection and the proper setup of the reflection filter.
Its nearly impossible to find valid informations, WHATS needed to use the current project classes in reflection.
Its possible for me to filter out every module in my "modules" folder, but no matter what - i cant see any classes of my project..

Tried:
Project's mainfile - called "main.monkey" (the App extend for Mojo and the Function Main:Int() are here) as #REFLECTION_FILTER = "main; main.*; main*"
Several classnames and subsources directly (eg src.*, src* and so on -> every imported class is in the \src\ subfolder)
Moving the whole project into a module that i've made and use (and which is possible to use with reflection)

After a while, i figured out, that i cant figure it out. So i tried #REFLECTION_FILTER = "*", to hopefully find the correct scope with some code (will post it below)
Sadly, monkey allows me to use "List< Int[] > " and so on, but no matter what, i will get an error: "[,...]/modules/monkey/list.monkey<28> : Error : Arrays cannot be compared.".

I fixed every usage of Array-lists by implementing an "IntArrayList" and so on and overloading the equals-method, but it still gives me the error.
For this, i used notepad++ and an regexp to find every match: "List<[\w\s\d]*\[" which means: Find every "List<", followed by a unknown number of letters, whitespaces and numbers, with [ as last char. <- Should find every list declaration, that uses arrays. Fixed everything, still the same error.


To check which classes are successfully loaded by the reflection stuff, i used the following code:
	Local classes:ClassInfo[]
	classes = GetClasses()
	For Local i:Int = 0 to classes.Length-1
		Print classes[i].Name()
	Next

(found here in the forum)
This prints me a bunch of classes+scopes for the filtered files. I hadn't checked doublechecked every class that's currently in my module (more then 50 classes here), but it looks like they are there. (this means, the filter works, right?)

So, can anyone explain me what iam doing wrong? Is "main.monkey" a bad filename due to the startup function "Main()"? Wont be that easy to change every import..
Why is the compiler still complaining, even if there are no List< **[] > anywhere?
Is there any way to find out, why the compiler is complaining? (eg. find the list-usage where it becomes mad)


PhillipK(Posted 2014) [#2]
I finally managed to reflect "*" by removing EVERY List< XXXX[] > with some dirty workarrounds.
After that, i saw the correct names (main. and src. ); Weirdly, i can use "src*" etc now as filter (most classes are in this subfolder, should be enough for my planned console).
However, "main" stillt wont work. :(