The shortest C# code that generates an uncatchable ExecutionEngineException wins. You are not allowed to call FailFast directly or indirectly.
\$\begingroup\$
\$\endgroup\$
1
-
4\$\begingroup\$ Welcome to programming puzzles and codegolf. There's a couple of reasons why you challenge may be unpopular: 1.If you search, you'll see we've had similar challenges before; 2. Language-specific challenges are frowned upon as they limit participation. I suggest you stick around, answer a few challenges and feel free to post the next one at meta.codegolf.stackexchange.com/questions/2140/… \$\endgroup\$Level River St– Level River St2014-11-18 20:14:13 +00:00Commented Nov 18, 2014 at 20:14
Add a comment
|
1 Answer
\$\begingroup\$
\$\endgroup\$
2
C# - 73
ThreadPool.QueueUserWorkItem(_=>{throw new ExecutionEngineException();});
Generates an ExecutionEngineException inside of a thread, so it can't be caught.
User CSharpie helped me shorten delegate to _=>.
-
1\$\begingroup\$ You should be able to replace delegate with a lambda _=> to make it even shorter. \$\endgroup\$CSharpie– CSharpie2014-11-18 16:41:42 +00:00Commented Nov 18, 2014 at 16:41
-
\$\begingroup\$ @CSharpie First time golfing in C#. Thanks for the tip! \$\endgroup\$Rainbolt– Rainbolt2014-11-18 17:33:28 +00:00Commented Nov 18, 2014 at 17:33