You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a dunet user, when using switch expression with dunet-generated unions, I don't want to be warned about the switch expression not being exhaustive when it is provably so.
For example, the following should not emit a warning:
usingstaticOption<int>;Option<int>option=new Some(1);varoutput=optionswitch{
Some some => some.Value.ToString(),
None =>"",};[Union]publicpartialrecordOption<T>{partialrecordSome(TValue);partialrecordNone();}
The text was updated successfully, but these errors were encountered:
What about creating a marker exception that tells dunet to run its own analyzer on this switch expression? That analyzer can do the proper exhaustiveness check with the knowledge that dunet unions are closed types. Something like:
Shapeshape=new Shape.Circle(3.14);vararea=shapeswitch{
Circle circle =>3.14* circle.Radius * circle.Radius,
Rectangle rect => rect.Length * rect.Width,
_ => Unreachable(),// Issues warning that there's no case for `Triangle`.};[Union]partialrecordShape{partialrecordCircle(doubleRadius);partialrecordRectangle(doubleLength,doubleWidth);partialrecordTriangle(doubleBase,doubleHeight);}
As a dunet user, when using switch expression with dunet-generated unions, I don't want to be warned about the switch expression not being exhaustive when it is provably so.
For example, the following should not emit a warning:
The text was updated successfully, but these errors were encountered: