@@ -2883,7 +2883,7 @@ namespace Microsoft.FSharp.Core
28832883 //-------------------------------------------------------------------------
28842884
28852885 [<DefaultAugmentation( false ) >]
2886- [<DebuggerDisplay( " Some({Value}) " ) >]
2886+ [<DebuggerDisplay( " {DebugDisplay,nq} " ) >]
28872887 [<CompilationRepresentation( CompilationRepresentationFlags.UseNullAsTrueValue) >]
28882888 [<CodeAnalysis.SuppressMessage( " Microsoft.Naming" , " CA1716:IdentifiersShouldNotMatchKeywords" , MessageId= " Option" ) >]
28892889 [<StructuralEquality; StructuralComparison>]
@@ -2907,6 +2907,11 @@ namespace Microsoft.FSharp.Core
29072907 static member Some ( value ) : 'T option = Some( value)
29082908
29092909 static member op_Implicit ( value ) : 'T option = Some( value)
2910+
2911+ member private x.DebugDisplay =
2912+ match x with
2913+ | None -> " None"
2914+ | Some _ -> String.Format( " Some({0})" , anyToStringShowingNull x.Value)
29102915
29112916 override x.ToString () =
29122917 // x is non-null, hence Some
@@ -2924,7 +2929,7 @@ namespace Microsoft.FSharp.Core
29242929 [<StructuralEquality; StructuralComparison>]
29252930 [<Struct>]
29262931 [<CompiledName( " FSharpValueOption`1" ) >]
2927- [<DebuggerDisplay( " ValueSome({Value}) " ) >]
2932+ [<DebuggerDisplay( " {DebugDisplay,nq} " ) >]
29282933 type ValueOption < 'T > =
29292934 | ValueNone : 'T voption
29302935 | ValueSome : 'T -> 'T voption
@@ -2942,11 +2947,17 @@ namespace Microsoft.FSharp.Core
29422947 [<DebuggerBrowsable( DebuggerBrowsableState.Never) >]
29432948 member x.IsSome = match x with ValueSome _ -> true | _ -> false
29442949
2945- static member op_Implicit ( value ) : 'T option = Some( value)
2946-
2947- override x.ToString () =
2948- // x is non-null, hence ValueSome
2949- " ValueSome(" ^ anyToStringShowingNull x.Value^ " )"
2950+ static member op_Implicit ( value ) : 'T voption = ValueSome( value)
2951+
2952+ member private x.DebugDisplay =
2953+ match x with
2954+ | ValueNone -> " ValueNone"
2955+ | ValueSome _ -> String.Format( " ValueSome({0})" , anyToStringShowingNull x.Value)
2956+
2957+ override x.ToString () =
2958+ match x with
2959+ | ValueNone -> " ValueNone"
2960+ | ValueSome _ -> anyToStringShowingNull x.Value
29502961
29512962 and 'T voption = ValueOption< 'T>
29522963
0 commit comments