Replies: 8 comments
-
Shouldn't this be a dotnet/corefx or dotnet/standard issue? |
Beta Was this translation helpful? Give feedback.
-
I assume is currently a language issue as you can't have null |
Beta Was this translation helpful? Give feedback.
-
You wouldn’t need to, if it threw an exception as described when HasValue is false. |
Beta Was this translation helpful? Give feedback.
-
I don't think such For example, this code: struct MyNullable<T>
{
T value;
ref T Reference => ref value;
} produces:
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Although if you used a field here then you can’t throw an exception if it’s null. |
Beta Was this translation helpful? Give feedback.
-
@svick Thanks. This is very sad. There are many existing function return nullable struct or logic using array of nullable and it has no easy way to edit internal value without copy |
Beta Was this translation helpful? Give feedback.
-
@sharwell
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
If it not be breaking change I wish
Value
property of nullable struct should return reference. But if it is I think we should have another property that would return reference of the struct in the nullable directlySomething like
Beta Was this translation helpful? Give feedback.
All reactions