// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Runtime.CompilerServices; struct R { int a; } public class X { public X(K k1) { k = k1; } [MethodImpl(MethodImplOptions.NoInlining)] public static bool Test(X a) { return (a.k != null); } public K k; } class B { public static int Main() { X a = null; bool result = false; try { X.Test(a); } catch (Exception) { result = true; } Console.WriteLine("Passed: {0}", result); return result ? 100 : 0; } }