reflection: fieldinfo and methodinfo. bug?

Monkey Forums/Monkey Programming/reflection: fieldinfo and methodinfo. bug?

wiebow(Posted 2012) [#1]
Try this code, several fields are not listed. (methodinfo, fieldinfo, field with list. The field with array is listed though.

Mark, is this a bug? FYI: I really need these in my unit test module to get dynamic adding of tests working. It would be great if it can be fixed.

#REFLECTION_FILTER="untitled*"

Import reflection

Function Main()
	For Local c:= eachin GetClasses()
		Print("Class: " + c.Name() )
		
		For Local m:= eachin c.GetMethods(true)
			Print(" Method: " + m.Name())
		Next
		
		For Local f:= eachin c.GetFields(true)
			Print( " Field: " + f.Name())
		Next
	Next
End

Class aa
	Method me()
	End
	
	Field fld:int	
	Field mei:MethodInfo
	Field fii:FieldInfo	
	Field lis:= New List<Object>
	Field arr:= new Int[10]
End



marksibly(Posted 2012) [#2]
Hi,

This is due to the reflection filter - get rid of it or try something like:

#REFLECTION_FILTER="untitled*|monkey*|reflection*"

Currently, stuff that isn't reflected is just ignored. Not sure if this is the best approach yet, but I wanted to play it safe to start with - ie: make the filter as effective as possible.


wiebow(Posted 2012) [#3]
Ahh, reflection needs reflection reflected to see the reflection specific fields and methods even when those are defined in the reflected class. Makes sense :) Thanks.