fbpx

compiler exception

More
8 months 2 weeks ago #1 by Stefan Hirsch
compiler exception was created by Stefan Hirsch
Hi Robert,

while testing AssemblyResolve handling I got a crash of the compiler.
Attached a screenshot of exception message and sample (viaef) for repoducing the crash.

Regards,
Stefan
Attachments:

Please Log in or Create an account to join the conversation.

More
8 months 2 weeks ago - 8 months 2 weeks ago #2 by Chris Pyrgas
Replied by Chris Pyrgas on topic compiler exception
Hi Stefan,

Thanks, I see the issue, it's because of the line
PRIVATE STATIC o := <VOID>{ AppDomain.CurrentDomain:AssemblyResolve += AssemblyResolver } AS OBJECT

(I have simplified it to make it more forum-readable)

Don't think this is supposed to compile, as the expression inside the {} does not return anything. Was this just a test of yours, or just a smart way to do the event subscribing? Normlly, I think you should be doing that in a static constructor instead:
STATIC CONSTRUCTOR()
  AppDomain.CurrentDomain:AssemblyResolve += AssemblyResolver
RETURN

Also better rename your Functions class to something else, like "Funcs", because the compiler already implicitly creates a class named "Functions", as a container for FUNCTIONs/PROCEDUREs/GLOBALs defined in the code.

Chris

XSharp Development Team
chris(at)xsharp.eu
Last edit: 8 months 2 weeks ago by Chris Pyrgas.

Please Log in or Create an account to join the conversation.

More
8 months 2 weeks ago #3 by Stefan Hirsch
Replied by Stefan Hirsch on topic compiler exception
Hi Chris,
The problem I had is solved.
My sample was just to reproduce a compiler crash. I think no app should crash without proper message (in this case a compile error).

Regards,
Stefan

Please Log in or Create an account to join the conversation.

More
8 months 2 weeks ago #4 by Chris Pyrgas
Replied by Chris Pyrgas on topic compiler exception
Ah ok, did not realize! Absolutely agreed about no crashing of course! Just some more info, this is actually a assertion failed message, it is shown only in the debug version of the compiler (the public one, FOX builds are release builds).

Chris

XSharp Development Team
chris(at)xsharp.eu

Please Log in or Create an account to join the conversation.