There is nothing wrong with the script. It is perfectly valid to have a non-shared class inherit from a shared class. The other way around is not valid though.

I'll give this new script a try and see if I can reproduce the problem.

[EDIT] Yes, now I was able to reproduce the problem. What happens is that when you discarded the module the object types were orphaned, but not yet destroyed as the garbage collector had not yet executed. When re-compiling the script the previously compiled and shared class was found again, but as it was orphaned, i.e. didn't belong to any module the code didn't behave correctly when trying to find the object methods.