-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
arch-wasmWebAssembly architectureWebAssembly architecturearea-GC-coreclros-browserBrowser variant of arch-wasmBrowser variant of arch-wasm
Milestone
Description
node .\corerun.js /throwcctor.dll
try
{
Console.WriteLine("Hello, World!");
Console.WriteLine("BOOM " + XXX.Something);
}
catch (Exception ex)
{
Console.WriteLine("Caught!");
Console.WriteLine("Caught : " + ex);
}
class XXX
{
static XXX()
{
Console.WriteLine("Static constructor called.");
throw new Exception("Exception in static constructor.");
}
private static string SomethingField = "Hi";
public static string Something
{
get
{
return SomethingField;
}
}
}expected
Hello, World!
Static constructor called.
Caught!
Caught : System.TypeInitializationException: The type initializer for 'XXX' threw an exception.
---> System.Exception: Exception in static constructor.
at XXX..cctor() in D:\samples\throwcctor\Program.cs:line 17
--- End of inner exception stack trace ---
at XXX.get_Something() in D:\samples\throwcctor\Program.cs:line 25
at Program.<Main>$(String[] args) in D:\samples\throwcctor\Program.cs:line 4
actual
Hello, World!
Static constructor called.
Caught!
Caught : System.Exception: Exception in static constructor.
at XXX..cctor()
at XXX.get_Something()
at Program.<Main>$(String[] args)
Assert failure(PID 42 [0x0000002a], Thread: 1 [0x0001]): The 'LastThrownObject' should not be, but is, NULL.
The runtime may have lost track of the type of an exception in flight.
Please get a good stack trace, find the caller of Validate, and file a bug against the owner.
To suppress this assert 'set DOTNET_SuppressLostExceptionTypeAssert=1'
File: D:/runtime/src/coreclr/vm/clrex.cpp:2125
Image: /managed
Aborted(native code called abort())
Metadata
Metadata
Assignees
Labels
arch-wasmWebAssembly architectureWebAssembly architecturearea-GC-coreclros-browserBrowser variant of arch-wasmBrowser variant of arch-wasm