Bug 33118 - Vb compiler creates invalid assembly if contains Events in special form
Summary: Vb compiler creates invalid assembly if contains Events in special form
Status: RESOLVED UPSTREAM
Alias: None
Product: Compilers
Classification: Mono
Component: VisualBasic ()
Version: 4.0.0
Hardware: PC All
: --- normal
Target Milestone: ---
Assignee: Rolf Bjarne Kvinge [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2015-08-14 17:32 UTC by Igor Kiselev
Modified: 2018-05-22 12:25 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Sample for issue reproducing (357 bytes, text/plain)
2015-08-14 17:32 UTC, Igor Kiselev
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED UPSTREAM

Description Igor Kiselev 2015-08-14 17:32:27 UTC
Created attachment 12512 [details]
Sample for issue reproducing

If in sources used event in form:
Event Evt As <DelegateType>
Then method that raise such event produce incorrect IL (that could not be loaded by any tools).

Please try attached example.

Steps to reproduce:
1. Compile attached program
2. Execute it

Expected result:
Program finish correctly

Actual result:
On Mono:
Unhandled Exception:
System.TypeLoadException: A type load exception has occurred.
  at Program.Main (System.String[] Args) [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: A type load exception has occurred.
  at Program.Main (System.String[] Args) [0x00000] in <filename unknown>:0
On .Net:
Unhandled Exception: System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
   at CustomType.FireEvent()
   at Program.Main(String[] Args)
Comment 1 Rolf Bjarne Kvinge [MSFT] 2018-05-22 12:25:10 UTC
Moved to: https://github.com/mono/mono-basic/issues/37