Bug 27728 - Exception in Exception filters (C# 6)
Summary: Exception in Exception filters (C# 6)
Alias: None
Product: Runtime
Classification: Mono
Component: JIT (show other bugs)
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-03-06 07:25 UTC by Marek Safar
Modified: 2018-02-28 23:57 UTC (History)
4 users (show)

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


Description Marek Safar 2015-03-06 07:25:04 UTC
Compile and Run

using System;
using static System.Console;

	class Program
		static void Main(string[] args)
				throw new Exception("TEST Exception");
			catch (Exception ex) when (MethodThatThrowsAnException())
				WriteLine("Filtered handler 1");
			catch (IndexOutOfRangeException ex)
				WriteLine("Index out of Range from Method Filter");

			catch (Exception ex)
				WriteLine("Forced Exception is caught " + ex);

		static bool MethodThatThrowsAnException()
			throw new IndexOutOfRangeException("Index Out of Range");

Unhandled Exception:
System.IndexOutOfRangeException: Index Out of Range
  at Program.Main (System.String[] args) [0x00000] in <filename unknown>:0


Forced Exception is caught System.Exception: TEST Exception
   at Program.Main(String[] args)
Comment 1 Ludovic Henry 2018-02-28 23:57:29 UTC
I can reproduce with Mono (master/798c5efa52a).

Note You need to log in before you can comment on or make changes to this bug.