using System;
public class C {
    public void TakeStruct<T>(T t) where T: struct
    {
    }
    
    public void Test()
    {
        var someStruct = new SomeStruct();
        SomeStruct? someStructNullable = new SomeStruct();
        MyOwnNullableImpl<SomeStruct> myNullable = new SomeStruct();
        
        TakeStruct(someStruct);
        // compiler error below
        TakeStruct(someStructNullable);
        TakeStruct(myNullable);
    }
    
    struct SomeStruct
    {
        public int A;
    }
    
    struct MyOwnNullableImpl<T> where T : struct
    {
        public readonly bool HasValue;
        
        public readonly T Value;
        
        public MyOwnNullableImpl(T t)
        {
            HasValue = true;
            Value = t;
        }
        
        public static implicit operator MyOwnNullableImpl<T>(T t) => new MyOwnNullableImpl<T>();
    }
        
}