Just of a curiosity, is there any practical use of "Void" struct
except in Reflection ?
System.Void
is the equivalent of the void
keyword. Check the tool tip of void
and it will display
struct System.Void
But it can't be used directly in C#, so you best ignore it.
Trying to use System.Void
will generate a compilation error
error CS0673: System.Void cannot be used from C# -- use typeof(void) to get the void type object
So then, it will fall to the topic of reflection only.
I think, but I'm not sure, that this struct is used by the compiler to generate il for functions with void return type
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With