From f7d84ceac672df9061aca5a266c8b394ff188e8a Mon Sep 17 00:00:00 2001 From: Hirotada Kiriyama Date: Mon, 12 Aug 2024 16:34:13 +0900 Subject: [PATCH] AssemblyBuilder: Fix the example not to ignore the created instance --- .../System.Reflection.Emit/AssemblyBuilder/Overview/24895.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/csharp/System.Reflection.Emit/AssemblyBuilder/Overview/24895.cs b/snippets/csharp/System.Reflection.Emit/AssemblyBuilder/Overview/24895.cs index 69bf416f7b0..40de04003c1 100644 --- a/snippets/csharp/System.Reflection.Emit/AssemblyBuilder/Overview/24895.cs +++ b/snippets/csharp/System.Reflection.Emit/AssemblyBuilder/Overview/24895.cs @@ -210,7 +210,7 @@ public int MyMethod(int multiplier) // property value. object? o2 = null; if (t is not null) - Activator.CreateInstance(t, new object[] { 5280 }); + o2 = Activator.CreateInstance(t, new object[] { 5280 }); Console.WriteLine("o2.Number: {0}", pi?.GetValue(o2, null)); } }