KITFORMA · EDITORIAL GUIDE
Why does boxing an empty nullable value produce null rather than Nullable<T>?
KitForma editorial guide. Boxing a nullable value follows its presence: no value boxes to null, while a present value boxes as the underlying value type. Reflection code expecting a boxed Nullable<T> can therefore make the wrong type assumption.
Step-by-step guidance
using System;
int? missing = null;
int? present = 7;
object? a = missing;
object? b = present;
Console.WriteLine(a is null);
Console.WriteLine(b?.GetType() == typeof(int));Sources and verification
Sources checked:
Scope: This editorial guide is based on the cited sources and tool behavior. A forum question or a query observed for our site does not establish market search volume, low competition, guaranteed rankings or inadequate answers elsewhere.
This starter guide was prepared by KitForma with AI assistance. It is not presented as a real member question or an independent user review. Check the sources and the result with your own file; report corrections in the discussion.