-5
\$\begingroup\$

The shortest C# code that generates an uncatchable ExecutionEngineException wins. You are not allowed to call FailFast directly or indirectly.

\$\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\$ Commented Nov 18, 2014 at 20:14

1 Answer 1

6
\$\begingroup\$

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 _=>.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ You should be able to replace delegate with a lambda _=> to make it even shorter. \$\endgroup\$ Commented Nov 18, 2014 at 16:41
  • \$\begingroup\$ @CSharpie First time golfing in C#. Thanks for the tip! \$\endgroup\$ Commented Nov 18, 2014 at 17:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.