From 9eaaa9f55787408e4d2fc2a580d7d97a8c5a9d16 Mon Sep 17 00:00:00 2001 From: Martin Evans Date: Mon, 6 Feb 2023 14:17:33 +0000 Subject: [PATCH] Added `ToString` method for `Mutability` struct --- src/Global.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Global.cs b/src/Global.cs index 95fc8806..8925b984 100644 --- a/src/Global.cs +++ b/src/Global.cs @@ -50,6 +50,17 @@ public override int GetHashCode() return Value.GetHashCode(); } + /// + public override string ToString() + { + return Value switch + { + 0 => nameof(Immutable), + 1 => nameof(Mutable), + _ => throw new ArgumentOutOfRangeException() + }; + } + /// /// Compare a to b and return true if they are equal ///