Replies: 3 comments
-
According to the C# language spec, the conversion from a
|
Beta Was this translation helpful? Give feedback.
-
Wow, how did I not realize for 20 years that you can implicitly cast a null literal to a value type as long as the value type has exactly 1 implicit reference type conversion defined? That's really strange. I don't know how I feel about that being allowed to begin with...it's just too weird to be able to set a value type to a null literal value, i.e. |
Beta Was this translation helpful? Give feedback.
-
I agree, its not exactly intuitive... And I'd rather there not be an implicit conversion between |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
So, a little context... I'm working with a binding around the Vulkan Graphics and Compute API, and some of its methods have Span and pointer overloads. I need to pass a
null
literal for this, but it's somehow ambiguous betweenSpan<T>
andT*
?Span<T>
has an implicit conversion from aT[]
array (which can notably be a null reference), causing this, but shouldn't it use a direct match to nullT*
instead of causing this ambiguous resolution?Beta Was this translation helpful? Give feedback.
All reactions