diff --git a/src/FsMessageTemplates/MessageTemplates.fs b/src/FsMessageTemplates/MessageTemplates.fs index c444f1f..5713062 100644 --- a/src/FsMessageTemplates/MessageTemplates.fs +++ b/src/FsMessageTemplates/MessageTemplates.fs @@ -453,7 +453,7 @@ module Destructure = match r.Hint with | DestrHint.Stringify -> ScalarValue (r.Value.ToString()) | _ -> TemplatePropertyValue.Empty let inline tryDelegateString (r:DestructureRequest) = - if r.Hint <> DestrHint.Destructure then TemplatePropertyValue.Empty + if r.Hint = DestrHint.Destructure then TemplatePropertyValue.Empty else match tryCastAs(r.Value) with | e when (Object.ReferenceEquals(null, e)) -> TemplatePropertyValue.Empty @@ -490,7 +490,7 @@ module Destructure = DictionaryValue skvps | e -> SequenceValue(e |> Seq.cast |> Seq.map r.TryAgainWithValue |> Seq.toList) - let inline scalarStringCatchAllDestr (r:DestructureRequest) = ScalarValue (r.Value.ToString()) + let inline scalarOriginCatchAllDestr (r:DestructureRequest) = ScalarValue (r.Value) let inline isPublicInstanceReadProp (p:PropertyInfo) = p.CanRead && p.GetMethod.IsPublic && not (p.GetMethod.IsStatic) && @@ -534,7 +534,7 @@ module Destructure = let inline alwaysKeepTrying (_:DestructureRequest) = TemplatePropertyValue.Empty /// Attempts all built-in destructurers in the correct order, falling - /// back to 'scalarStringCatchAllDestr' (stringify) if no better option + /// back to 'scalarOriginCatchAllDestr' (origin) if no better option /// is found first. Also supports custom scalars and custom object /// destructuring at the appropriate points in the pipline. Note this is /// called recursively in a tight loop during the process of capturing @@ -559,7 +559,7 @@ module Destructure = | tpv when isEmptyKeepTrying tpv -> match tryObjectStructureDestructuring request with | tpv when isEmptyKeepTrying tpv -> - match scalarStringCatchAllDestr request with + match scalarOriginCatchAllDestr request with | tpv when isEmptyKeepTrying tpv -> TemplatePropertyValue.Empty | tpv -> tpv | tpv -> tpv