Comparing boxed value types

后端 未结 5 1039
轮回少年
轮回少年 2020-11-28 13:06

Today I stumbled upon an interesting bug I wrote. I have a set of properties which can be set through a general setter. These properties can be value types or reference type

5条回答
  •  醉酒成梦
    2020-11-28 13:41

    Since the input parameter's type is object, you will always get a boxed value inside the method's context.

    I think your only chance is to change the method's signature and to write different overloads.

提交回复
热议问题