diff --git a/src/libraries/System.Private.CoreLib/src/System/Type.cs b/src/libraries/System.Private.CoreLib/src/System/Type.cs index 17e4636296c177..24be352778c841 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Type.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Type.cs @@ -135,7 +135,15 @@ public bool IsPrimitive get => IsPrimitiveImpl(); } protected abstract bool IsPrimitiveImpl(); - public bool IsValueType { [Intrinsic] get => IsValueTypeImpl(); } + public bool IsValueType + { +#if NATIVEAOT + // https://github.com/dotnet/runtime/issues/97272 + [MethodImpl(MethodImplOptions.NoOptimization)] +#endif + [Intrinsic] + get => IsValueTypeImpl(); + } protected virtual bool IsValueTypeImpl() => IsSubclassOf(typeof(ValueType)); [Intrinsic]