Skip to content

Commit 9c1908e

Browse files
committed
t
1 parent 3073c10 commit 9c1908e

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

CLRSharp/CLRSharp/Execute/StackFrame.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2412,12 +2412,14 @@ public void Castclass(ThreadContext context, ICLRType _type)
24122412
if (obj != null)
24132413
{
24142414
var ssypt = (_type as ICLRType_System).TypeForSystem;
2415+
var otype = obj.GetType();
24152416

2416-
if (obj.GetType().IsSubclassOf(ssypt) == false && ssypt.IsSubclassOf(typeof(Delegate)) == false)
2417+
if (otype != ssypt && obj.GetType().IsSubclassOf(ssypt) == false)
24172418
{
24182419
throw new Exception("不可转换");
24192420
}
24202421

2422+
24212423
}
24222424
}
24232425

UnitTestDll/Test0.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class Test0
1111
{
1212
public static void UnitTest_delegate()
1313
{
14-
Action calBak = new Action(target1);
14+
TestDele.myup calBak = new TestDele.myup(target1);
1515
calBak += target2;
1616
}
1717

0 commit comments

Comments
 (0)