-
Notifications
You must be signed in to change notification settings - Fork 593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MetricsFailures is non-nullable in C# #2573
Conversation
@@ -182,9 +182,9 @@ internal IceMX.MetricsFailures getFailures() | |||
{ | |||
if (_failures == null) | |||
{ | |||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was bogus. We no longer accept null for struct parameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the generated type a record class and not a record struct?
public sealed partial record class MetricsFailures
Is this bogus, or did we change the default mapping for structs to record class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not bogus. In C#, the default mapping for most Slice structs, including struct MetricsFailures
, is a C# class. For Ice 3.8, it's a "record class" instead of a plain class.
@@ -880,7 +880,7 @@ override public IceMX.MetricsFailures[] getMapMetricsFailures(string viewName, s | |||
{ | |||
return view.getFailures(mapName, id); | |||
} | |||
return new IceMX.MetricsFailures("", null); // null == dictionary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was bogus too. We actually verify in the generated constructor the second parameter is non-null. This code appears untested.
@@ -182,9 +182,9 @@ internal IceMX.MetricsFailures getFailures() | |||
{ | |||
if (_failures == null) | |||
{ | |||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the generated type a record class and not a record struct?
public sealed partial record class MetricsFailures
Is this bogus, or did we change the default mapping for structs to record class?
Fixes #2567.