The following code will generate a run-time exception. However, if I un-comment key.GetHashCode()
, I got Internal Error:
Severity Code Description Project File Line Suppression State
Error (E0) Internal error: System.AggregateException: One or more errors occurred. —> System.InvalidOperationException: Operation is not valid due to the current state of the object.
type
MyClass = class
private
fData: Integer;
public
end;
Program = class
public
class method Main(args: array of String): Int32;
begin
// add your own code here
writeLn('The magic happens here.');
var cache := new Dictionary<^Void,HWND>;
var mycls := new MyClass;
var key := ^Void(@mycls);
//key.GetHashCode(); // <--- Un-Comment this will cause a Internal Error
cache.Add(key, nil);
writeLn('OK.');
end;