From ade3491ca31ef60c7af325d8f9220e496368b1d4 Mon Sep 17 00:00:00 2001 From: Gustavo Guerra Date: Sat, 1 Nov 2014 23:07:06 +0000 Subject: [PATCH] Workaround for https://github.com/fsharp/FSharp.Compiler.Service/issues/249 --- src/FSharp.MetadataFormat/Main.fs | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/FSharp.MetadataFormat/Main.fs b/src/FSharp.MetadataFormat/Main.fs index 0434e3bab..482bb4ed5 100644 --- a/src/FSharp.MetadataFormat/Main.fs +++ b/src/FSharp.MetadataFormat/Main.fs @@ -553,19 +553,27 @@ module Reader = // comment. let getXmlDocSigForType (typ:FSharpEntity) = - match (typ.XmlDocSig, typ.TryFullName) with - | "", None -> "" - | "", Some(n) -> sprintf "T:%s" n - | n , _ -> n + match typ.XmlDocSig with + | "" -> + try + defaultArg + (Option.map (sprintf "T:%s") typ.TryFullName) + "" + with _ -> "" + | n -> n let getMemberXmlDocsSigPrefix (memb:FSharpMemberFunctionOrValue) = if memb.IsProperty then "P" else "M" let getXmlDocSigForMember (memb:FSharpMemberFunctionOrValue) = - match (memb.XmlDocSig, memb.EnclosingEntity.TryFullName) with - | "", None -> "" - | "", Some(n) -> sprintf "%s:%s.%s" (getMemberXmlDocsSigPrefix memb) n memb.CompiledName - | n, _ -> n + match memb.XmlDocSig with + | "" -> + try + defaultArg + (Option.map (fun n -> sprintf "%s:%s.%s" (getMemberXmlDocsSigPrefix memb) n memb.CompiledName) memb.EnclosingEntity.TryFullName) + "" + with _ -> "" + | n -> n // // ---------------------------------------------------------------------