New
v1.14.0
What's Changed
- Some property patterns are now also checked for exhaustiveness. For example:
[Union]
partial record Shape
{
partial record Circle(double Radius);
partial record Rectangle(double Length, double Width);
partial record Triangle(double Base, double Height);
}
Shape shape = new Circle(3.14);
var area = shape switch
{
// This is now considered as handling the `Rectangle` case.
Rectangle { Length: var length, Width: var width } => length * width,
Circle(var radius) => 3.14 * radius * radius,
Triangle t => t.Base * t.Height / 2,
};
var area2 = shape switch
{
// This is now considered as handling the `Rectangle` case.
Rectangle { Length: _, Width: _ } => 0,
Circle(var radius) => 3.14 * radius * radius,
Triangle t => t.Base * t.Height / 2,
};
Packages
https://www.nuget.org/packages/Dunet/1.14.0
Full Changelog
https://github.com/domn1995/dunet/compare/v1.13.1...v1.14.0