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
compiler exception
compiler exception
- Attachments
-
- CompilerCrash.zip
- (1.47 KiB) Downloaded 62 times
-
- XS_CompilerCrash.PNG (25.75 KiB) Viewed 399 times
compiler exception
Hi Stefan,
Thanks, I see the issue, it's because of the line
(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:
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
Thanks, I see the issue, it's because of the line
Code: Select all
PRIVATE STATIC o := <VOID>{ AppDomain.CurrentDomain:AssemblyResolve += AssemblyResolver } AS OBJECT
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:
Code: Select all
STATIC CONSTRUCTOR()
AppDomain.CurrentDomain:AssemblyResolve += AssemblyResolver
RETURN
Chris
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
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
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
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
Chris
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu