Skip to content

The finalizer is run for a partially constructed object for MonoVM #41272

Description

@marek-safar

There is a change in .NET Core which makes this code to behave differently than on .NET Framework.

using System;

	class Program {
		static void Main ()
		{
			X x;
			try {
				x = new X ();
			} catch (ApplicationException) {
			}
		}
	}

	class X {
		public X () => throw new ApplicationException ();
		~X () => throw new NotImplementedException ();
	}

With MonoVM it prints

System.NotImplementedException: The method or operation is not implemented.

but it should not (it does not with CoreCLR VM).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions