fbpx
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: compiler exception

compiler exception 1 year 2 months ago #4633

  SHirsch's Avatar Topic Author SHirsch Offline Posts: 116
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.

compiler exception 1 year 2 months ago #4640

  Chris's Avatar Chris Offline Posts: 1226
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

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

Last edit: by Chris.

compiler exception 1 year 2 months ago #4645

  SHirsch's Avatar Topic Author SHirsch Offline Posts: 116
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.

compiler exception 1 year 2 months ago #4647

  Chris's Avatar Chris Offline Posts: 1226
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.

  • Page:
  • 1