reflections - modules which may disable it?

BlitzMax Forums/BlitzMax Programming/reflections - modules which may disable it?

Derron(Posted 2007) [#1]
Hi,

if I just do a simple example on reflections (printing fields and fieldtypes) within a new file (so only the example has to be compiled) everything works as it is expected to work.

If add the code (the one from the docs is enough) to my games code I get a crash on:

reflection.bmx:
Function TypeIdForTag:TTypeId( ty$ )
...
	For Local i=0 Until ar
>> HERE >>		id=id.ArrayType()
	Next...
...

Error is: Unhandled Exception:Attempt to access field or method of Null object.

Seems the compiler doesn't recognize some field-types.


In my game I'm using the DX9-Module and some things like XML and Zip-Archiving (including c-sources). May some of them prevent reflections from working?

Sure I could spend some hours fiddling with adding some of my includes/imports to a small example-file to narrow it down to a certain point within the code. But my hope are you, who may already have solved this problem.

Thanks,

bye
MB


dmaz(Posted 2007) [#2]
well, there's not a lot of code there but judging from the error I would say "id" is null.


Azathoth(Posted 2007) [#3]
There does seem to be some bugs when it comes to reflection and arrays. I've made a clone function that will clone any object however arrays in a type causes the debugger to crash.


Derron(Posted 2007) [#4]
When just "using" brl.basic.reflections nothing happens, but when including the example source from the manual in my source code the compilation crashes.

As I use superstrict I think I set all variables/fields to certain types.

And for my source code being around 1,8MB (count only bmx-files no .c or .h) it's hard to post the code here without having narrowed it down.


bye
MB


Dreamora(Posted 2007) [#5]
have you imported brl.retro / basic as well?

most brl own modules somewhere reference stuff from there.


Derron(Posted 2007) [#6]
Sorry if I said it a not very specific way... the compilation (the exe-file) crashes... so not the compiler itself.

btw brl.retro is imported too.

Think something just disturbs brl's reflection.. but I still don't know what it is.


bye
MB


Derron(Posted 2007) [#7]
---edit
strange ... no quick build enabled and 2 times tried - one time crash, one time it worked (within the small test-example-case)...

Will have to investigate further ;D

---edit2
Ok... the DX9-Module makes things not work ... commented it out and it seems to work now...

Some ideas to solve the problem of this module vs. reflection?


bye
MB


Dreamora(Posted 2007) [#8]
Not adopted for BM 1.26 so it might use some "hacks" for its inner working which just don't work anymore with the reworked core modules of BM

did you rebuild the DX9 module and all other 3rd party modules?


Derron(Posted 2007) [#9]
Rebuilt everything but maxgui/png.

For the time being a problem i commented the dx9-thingies out.

I hope budman (think he wrote it) updates his module to work in 1.26.


bye
MB