static T? ReturnInput<T>(T? t) where T : struct => t;
var p = ReturnInput("test"); // Doesn't compile, 'string' isn't a struct
var q = ReturnInput(3); // Doesn't compile, 'int' is a struct but the compiler can't make the leap that you want to
// implictly convert an object of type 'int' to 'int?', and that therefore T should be 'int'
// (add explicit type parameter indication in angle brackets to fix)
var r = ReturnInput<int>(null); // Compiles, T is 'int' and the input parameter is default(Nullable<int>)
Code snippet taken from "Complete C# Quick Reference - C# 8".