Strange assembly issue on web platform (FieldAccessException)

Trying to get a game running on the web platform and getting this error in the editor:

FieldAccessException: Error verifying SomeClass:SomeFunction (ArgumentClass): Type at stack is not accessible at 0x021e

There are some indications the same problem is happening in the web browser, but as yet I haven’t figured out how to see the “console” there (if such a thing exists).

From the little bit I’ve dug up in searching, it looks like some kind of compilation error - the message that the function in question is marked in the script assembly as private, but that doesn’t make sense since a) if I make it public/protected/private it doesn’t matter, and b) the function is called from the same class so it shouldn’t matter anyway. Plus, we’re not seeing this on other platforms (Mac/iOS/Android). If it makes a difference, the source files in question are in javascript.

I’ve restarted the editor, saved the files in question with minor changes to force a recompile, and wiped out the ScriptAssemblies directory… somebody stop me before I get out the chicken bones and eagle feathers.

There is no console in the webplayer, but you can look at the log.

As for its not happening on any other platform: The Webplayer is the most restricted platform in relation to code, various things are disabled for security reasons (anything that basically can directly or indirectly be missused to access the system, use sideffects to do so, …)

Urgh, I found it by commenting out pieces of the function in question until I found the actual line it was complaining about. It was a reference to a protected member in a parent class in common between two child classes (so A and B extend C, and a function in A dereferences the member through an instance of B)

An easy fix once I found it. I don’t know the mono/.Net internals, but I’d think there could be some way to have a more informative error message… though I do have a sense of why it might be tricky.