Open baehny opened 6 years ago
@baehny I have given a try to reproduce your issue using "Try JSIL" about delegate called in a constructor.
http://jsil.org/try/#150e92605a2cfcfdaa5acea34a93f404
While your context may be different, could you kindly tell me if my test case is different from your example?
It seems that a delegate called in constructor placed into Main
mathod does not crash.
Your example looks very similar. If I test my setup with "Try JSIL" it works too so it must be some side effect of my project. I'm pretty sure that "Try JSIL" uses .Net Framework 4.5 or lower while my project uses 4.7.1. I have to do further investigation if I have some time but sadly I'm quite busy right now.
I have uploaded a test project that recreates the issue with a minimal setup. The project targets .Net Framework 4.5
https://github.com/baehny/Bugs/tree/master/JSIL/JSIL_DelegateMethodInCtor
Delegate.Method crashs when called in a constructor. The same code works when called inside a member method that is called in the ctor.