未验证 提交 2f5befa8 编写于 作者: D dotnet-automerge-bot 提交者: GitHub

Merge pull request #5722 from Microsoft/merges/master-to-dev16.0

Merge master to dev16.0

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2036
VisualStudioVersion = 15.0.28010.2036
MinimumVisualStudioVersion = 10.0.40219.1
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.VS.FSI", "vsintegration\src\FSharp.VS.FSI\FSharp.VS.FSI.fsproj", "{991DCF75-C2EB-42B6-9A0D-AA1D2409D519}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Compiler.Private", "src\fsharp\FSharp.Compiler.Private\FSharp.Compiler.Private.fsproj", "{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.VS.FSI", "vsintegration\src\FSharp.VS.FSI\FSharp.VS.FSI.fsproj", "{991DCF75-C2EB-42B6-9A0D-AA1D2409D519}"
ProjectSection(ProjectDependencies) = postProject
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3} = {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}
EndProjectSection
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VisualFSharpFull", "vsintegration\Vsix\VisualFSharpFull\VisualFSharpFull.csproj", "{59ADCE46-9740-4079-834D-9A03A3494EBC}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Compiler.Server.Shared", "src\fsharp\FSharp.Compiler.Server.Shared\FSharp.Compiler.Server.Shared.fsproj", "{D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}"
EndProject
......@@ -65,14 +64,8 @@ EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Compiler.Interactive.Settings", "src\fsharp\FSharp.Compiler.Interactive.Settings\FSharp.Compiler.Interactive.Settings.fsproj", "{649FA588-F02E-457C-9FCF-87E46407481E}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FsiAnyCPU", "src\fsharp\fsiAnyCpu\FsiAnyCPU.fsproj", "{8B3E283D-B5FE-4055-9D80-7E3A32F3967B}"
ProjectSection(ProjectDependencies) = postProject
{649FA588-F02E-457C-9FCF-87E46407481E} = {649FA588-F02E-457C-9FCF-87E46407481E}
EndProjectSection
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Fsi", "src\fsharp\fsi\Fsi.fsproj", "{D0E98C0D-490B-4C61-9329-0862F6E87645}"
ProjectSection(ProjectDependencies) = postProject
{649FA588-F02E-457C-9FCF-87E46407481E} = {649FA588-F02E-457C-9FCF-87E46407481E}
EndProjectSection
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Tests.FSharpSuite", "tests\fsharp\FSharp.Tests.FSharpSuite.fsproj", "{C163E892-5BF7-4B59-AA99-B0E8079C67C4}"
EndProject
......@@ -115,10 +108,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TextFile", "vsintegration\I
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XMLFile", "vsintegration\ItemTemplates\XMLFile\XMLFile.csproj", "{1FB1DD07-06AA-45B4-B5AC-20FF5BEE98B6}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Vsix", "Vsix", "{141F6C23-E1B1-4D89-9F10-F0B8AD58E71F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VisualFSharpFull", "vsintegration\Vsix\VisualFSharpFull\VisualFSharpFull.csproj", "{59ADCE46-9740-4079-834D-9A03A3494EBC}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "HostedCompilerServer", "tests\fsharpqa\testenv\src\HostedCompilerServer\HostedCompilerServer.fsproj", "{4239EFEA-E746-446A-BF7A-51FCBAB13946}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "ILComparer", "tests\fsharpqa\testenv\src\ILComparer\ILComparer.fsproj", "{2E60864A-E3FF-4BCC-810F-DC7C34E6B236}"
......@@ -155,14 +144,6 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|x86.ActiveCfg = Debug|Any CPU
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|x86.Build.0 = Debug|Any CPU
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|Any CPU.Build.0 = Release|Any CPU
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|x86.ActiveCfg = Release|Any CPU
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|x86.Build.0 = Release|Any CPU
{991DCF75-C2EB-42B6-9A0D-AA1D2409D519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{991DCF75-C2EB-42B6-9A0D-AA1D2409D519}.Debug|Any CPU.Build.0 = Debug|Any CPU
{991DCF75-C2EB-42B6-9A0D-AA1D2409D519}.Debug|x86.ActiveCfg = Debug|Any CPU
......@@ -171,6 +152,22 @@ Global
{991DCF75-C2EB-42B6-9A0D-AA1D2409D519}.Release|Any CPU.Build.0 = Release|Any CPU
{991DCF75-C2EB-42B6-9A0D-AA1D2409D519}.Release|x86.ActiveCfg = Release|Any CPU
{991DCF75-C2EB-42B6-9A0D-AA1D2409D519}.Release|x86.Build.0 = Release|Any CPU
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|x86.ActiveCfg = Debug|Any CPU
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|x86.Build.0 = Debug|Any CPU
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|Any CPU.Build.0 = Release|Any CPU
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|x86.ActiveCfg = Release|Any CPU
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|x86.Build.0 = Release|Any CPU
{59ADCE46-9740-4079-834D-9A03A3494EBC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{59ADCE46-9740-4079-834D-9A03A3494EBC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{59ADCE46-9740-4079-834D-9A03A3494EBC}.Debug|x86.ActiveCfg = Debug|Any CPU
{59ADCE46-9740-4079-834D-9A03A3494EBC}.Debug|x86.Build.0 = Debug|Any CPU
{59ADCE46-9740-4079-834D-9A03A3494EBC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{59ADCE46-9740-4079-834D-9A03A3494EBC}.Release|Any CPU.Build.0 = Release|Any CPU
{59ADCE46-9740-4079-834D-9A03A3494EBC}.Release|x86.ActiveCfg = Release|Any CPU
{59ADCE46-9740-4079-834D-9A03A3494EBC}.Release|x86.Build.0 = Release|Any CPU
{D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Debug|x86.ActiveCfg = Debug|Any CPU
......@@ -483,14 +480,6 @@ Global
{1FB1DD07-06AA-45B4-B5AC-20FF5BEE98B6}.Release|Any CPU.Build.0 = Release|Any CPU
{1FB1DD07-06AA-45B4-B5AC-20FF5BEE98B6}.Release|x86.ActiveCfg = Release|Any CPU
{1FB1DD07-06AA-45B4-B5AC-20FF5BEE98B6}.Release|x86.Build.0 = Release|Any CPU
{59ADCE46-9740-4079-834D-9A03A3494EBC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{59ADCE46-9740-4079-834D-9A03A3494EBC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{59ADCE46-9740-4079-834D-9A03A3494EBC}.Debug|x86.ActiveCfg = Debug|Any CPU
{59ADCE46-9740-4079-834D-9A03A3494EBC}.Debug|x86.Build.0 = Debug|Any CPU
{59ADCE46-9740-4079-834D-9A03A3494EBC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{59ADCE46-9740-4079-834D-9A03A3494EBC}.Release|Any CPU.Build.0 = Release|Any CPU
{59ADCE46-9740-4079-834D-9A03A3494EBC}.Release|x86.ActiveCfg = Release|Any CPU
{59ADCE46-9740-4079-834D-9A03A3494EBC}.Release|x86.Build.0 = Release|Any CPU
{4239EFEA-E746-446A-BF7A-51FCBAB13946}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4239EFEA-E746-446A-BF7A-51FCBAB13946}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4239EFEA-E746-446A-BF7A-51FCBAB13946}.Debug|x86.ActiveCfg = Debug|Any CPU
......@@ -584,8 +573,9 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3} = {3881429D-A97A-49EB-B7AE-A82BA5FE9C77}
{991DCF75-C2EB-42B6-9A0D-AA1D2409D519} = {4C7B48D7-19AF-4AE7-9D1D-3BB289D5480D}
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3} = {3881429D-A97A-49EB-B7AE-A82BA5FE9C77}
{59ADCE46-9740-4079-834D-9A03A3494EBC} = {4C7B48D7-19AF-4AE7-9D1D-3BB289D5480D}
{D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06} = {B8DDA694-7939-42E3-95E5-265C2217C142}
{DED3BBD7-53F4-428A-8C9F-27968E768605} = {3058BC79-8E79-4645-B05D-48CC182FA8A6}
{EE85AAB7-CDA0-4C4E-BDA0-A64CCC413E3F} = {4C7B48D7-19AF-4AE7-9D1D-3BB289D5480D}
......@@ -629,8 +619,6 @@ Global
{E3FDD4AC-46B6-4B9F-B672-317D1202CC50} = {F6DAEE9A-8BE1-4C4A-BC83-09215517C7DA}
{D11FC318-8F5D-4C8C-9287-AB40A016D13C} = {F6DAEE9A-8BE1-4C4A-BC83-09215517C7DA}
{1FB1DD07-06AA-45B4-B5AC-20FF5BEE98B6} = {F6DAEE9A-8BE1-4C4A-BC83-09215517C7DA}
{141F6C23-E1B1-4D89-9F10-F0B8AD58E71F} = {4C7B48D7-19AF-4AE7-9D1D-3BB289D5480D}
{59ADCE46-9740-4079-834D-9A03A3494EBC} = {141F6C23-E1B1-4D89-9F10-F0B8AD58E71F}
{4239EFEA-E746-446A-BF7A-51FCBAB13946} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}
{2E60864A-E3FF-4BCC-810F-DC7C34E6B236} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}
{D086C8C6-D00D-4C3B-9AB2-A4286C9F5922} = {4C7B48D7-19AF-4AE7-9D1D-3BB289D5480D}
......
......@@ -154,12 +154,11 @@ let unsplitTypeName (ns, n) =
| [] -> String.concat "." ns + "." + n
| _ -> n
let splitTypeNameRightAux nm =
if String.contains nm '.' then
let idx = String.rindex nm '.'
let s1, s2 = splitNameAt nm idx
Some s1, s2
else None, nm
let splitTypeNameRightAux (nm:string) =
let idx = nm.LastIndexOf '.'
if idx = -1 then None, nm else
let s1, s2 = splitNameAt nm idx
Some s1, s2
let splitTypeNameRight nm =
memoizeNamespaceRightTable.GetOrAdd(nm, splitTypeNameRightAux)
......@@ -4189,23 +4188,6 @@ let resolveILMethodRef td mref = resolveILMethodRefWithRescope id td mref
let mkRefToILModule m =
ILModuleRef.Create(m.Name, true, None)
let ungenericizeTypeName n =
let sym = '`'
if
String.contains n sym &&
(* check what comes after the symbol is a number *)
(let m = String.rindex n sym
let res = ref (m < n.Length - 1)
for i = m + 1 to n.Length - 1 do
res := !res && n.[i] >= '0' && n.[i] <= '9'
!res)
then
let pos = String.rindex n sym
String.sub n 0 pos
else n
type ILEventRef =
{ erA: ILTypeRef; erB: string }
static member Create(a, b) = {erA=a;erB=b}
......
......@@ -1540,9 +1540,6 @@ val typeNameForGlobalFunctions: string
val isTypeNameForGlobalFunctions: string -> bool
val ungenericizeTypeName: string -> string (* e.g. List`1 --> List *)
// ====================================================================
// PART 2
//
......
......@@ -452,23 +452,13 @@ type String with
member inline x.EndsWithOrdinal(value) =
x.EndsWith(value, StringComparison.Ordinal)
module String =
let indexNotFound() = raise (new KeyNotFoundException("An index for the character was not found in the string"))
module String =
let make (n: int) (c: char) : string = new String(c, n)
let get (str:string) i = str.[i]
let sub (s:string) (start:int) (len:int) = s.Substring(start,len)
let index (s:string) (c:char) =
let r = s.IndexOf(c)
if r = -1 then indexNotFound() else r
let rindex (s:string) (c:char) =
let r = s.LastIndexOf(c)
if r = -1 then indexNotFound() else r
let contains (s:string) (c:char) = s.IndexOf(c) <> -1
let order = LanguagePrimitives.FastGenericComparer<string>
......
......@@ -3082,7 +3082,7 @@
<value>This number is outside the allowable range for 32-bit floats</value>
</data>
<data name="lexInvalidNumericLiteral" xml:space="preserve">
<value>This is not a valid numeric literal. Valid numeric literals include 1, 0x1, 0b0001 (int), 1u (uint32), 1L (int64), 1UL (uint64), 1s (int16), 1y (sbyte), 1uy (byte), 1.0 (float), 1.0f (float32), 1.0m (decimal), 1I (BigInteger).</value>
<value>This is not a valid numeric literal. Valid numeric literals include 1, 0x1, 0b0001 (int), 1u (uint32), 1L (int64), 1UL (uint64), 1s (int16), 1us (uint16), 1y (sbyte), 1uy (byte), 1.0 (float), 1.0f (float32), 1.0m (decimal), 1I (BigInteger).</value>
</data>
<data name="lexInvalidByteLiteral" xml:space="preserve">
<value>This is not a valid byte literal</value>
......@@ -4378,4 +4378,4 @@
<data name="chkInvalidFunctionReturnType" xml:space="preserve">
<value>The function or method has an invalid return type '{0}'. This is not permitted by the rules of Common IL.</value>
</data>
</root>
\ No newline at end of file
</root>
......@@ -2609,13 +2609,13 @@ type TcConfigBuilder =
member tcConfigB.RemoveReferencedAssemblyByPath (m, path) =
tcConfigB.referencedDLLs <- tcConfigB.referencedDLLs |> List.filter (fun ar-> ar.Range <> m || ar.Text <> path)
static member SplitCommandLineResourceInfo ri =
if String.contains ri ',' then
let p = String.index ri ','
static member SplitCommandLineResourceInfo (ri:string) =
let p = ri.IndexOf ','
if p <> -1 then
let file = String.sub ri 0 p
let rest = String.sub ri (p+1) (String.length ri - p - 1)
if String.contains rest ',' then
let p = String.index rest ','
let p = rest.IndexOf ','
if p <> -1 then
let name = String.sub rest 0 p+".resources"
let pubpri = String.sub rest (p+1) (rest.Length - p - 1)
if pubpri = "public" then file, name, ILResourceAccess.Public
......
......@@ -985,10 +985,8 @@ type TypeNameResolutionStaticArgsInfo =
// Get the first possible mangled name of the type, assuming the args are generic args
member x.MangledNameForType nm =
if IsMangledGenericName nm || x.NumStaticArgs = 0 then nm
else nm+"`"+string x.NumStaticArgs
if x.NumStaticArgs = 0 || TryDemangleGenericNameAndPos nm <> ValueNone then nm
else nm + "`" + string x.NumStaticArgs
[<NoEquality; NoComparison>]
/// Represents information which guides name resolution of types.
......@@ -1018,7 +1016,11 @@ let LookupTypeNameInEntityHaveArity nm (staticResInfo: TypeNameResolutionStaticA
/// Unqualified lookups of type names where the number of generic arguments is known
/// from context, e.g. List<arg>. Rebindings due to 'open' may have rebound identifiers.
let LookupTypeNameInEnvHaveArity fq nm numTyArgs (nenv:NameResolutionEnv) =
let key = if IsMangledGenericName nm then DecodeGenericTypeName nm else NameArityPair(nm,numTyArgs)
let key =
match TryDemangleGenericNameAndPos nm with
| ValueSome pos -> DecodeGenericTypeName pos nm
| _ -> NameArityPair(nm,numTyArgs)
match nenv.TyconsByDemangledNameAndArity(fq).TryFind(key) with
| Some res -> Some res
| None -> nenv.TyconsByAccessNames(fq).TryFind nm |> Option.map List.head
......@@ -1041,15 +1043,17 @@ let LookupTypeNameInEnvHaveArity fq nm numTyArgs (nenv:NameResolutionEnv) =
// also be used to qualify access if needed, though this is almost never needed.
let LookupTypeNameNoArity nm (byDemangledNameAndArity: LayeredMap<NameArityPair,_>) (byAccessNames: LayeredMultiMap<string,_>) =
if IsMangledGenericName nm then
match byDemangledNameAndArity.TryFind (DecodeGenericTypeName nm) with
| Some res -> [res]
| None ->
match byAccessNames.TryFind nm with
| Some res -> res
| None -> []
else
byAccessNames.[nm]
match TryDemangleGenericNameAndPos nm with
| ValueSome pos ->
let demangled = DecodeGenericTypeName pos nm
match byDemangledNameAndArity.TryFind demangled with
| Some res -> [res]
| None ->
match byAccessNames.TryFind nm with
| Some res -> res
| None -> []
| _ ->
byAccessNames.[nm]
/// Qualified lookup of type names in the environment
let LookupTypeNameInEnvNoArity fq nm (nenv: NameResolutionEnv) =
......
......@@ -102,7 +102,7 @@ module private PrintIL =
open Microsoft.FSharp.Compiler.AbstractIL.IL
let fullySplitILTypeRef (tref:ILTypeRef) =
(List.collect IL.splitNamespace (tref.Enclosing @ [IL.ungenericizeTypeName tref.Name]))
(List.collect IL.splitNamespace (tref.Enclosing @ [PrettyNaming.DemangleGenericTypeName tref.Name]))
let layoutILTypeRefName denv path =
let path =
......@@ -193,7 +193,7 @@ module private PrintIL =
let args = signatur.ArgTypes |> List.map (layoutILType denv ilTyparSubst)
let res =
match cons with
| Some className -> layoutILTypeRefName denv (SplitNamesForILPath (ungenericizeTypeName className)) ^^ (pruneParms className ilTyparSubst |> paramsL) // special case for constructor return-type (viz., the class itself)
| Some className -> layoutILTypeRefName denv (SplitNamesForILPath (PrettyNaming.DemangleGenericTypeName className)) ^^ (pruneParms className ilTyparSubst |> paramsL) // special case for constructor return-type (viz., the class itself)
| None -> signatur.ReturnType |> layoutILType denv ilTyparSubst
match args with
| [] -> WordL.structUnit ^^ WordL.arrow ^^ res
......@@ -226,7 +226,7 @@ module private PrintIL =
// return type be passed along as the `cons` parameter.)
let res =
match cons with
| Some className -> layoutILTypeRefName denv (SplitNamesForILPath (ungenericizeTypeName className)) ^^ (pruneParms className ilTyparSubst |> paramsL) // special case for constructor return-type (viz., the class itself)
| Some className -> layoutILTypeRefName denv (SplitNamesForILPath (PrettyNaming.DemangleGenericTypeName className)) ^^ (pruneParms className ilTyparSubst |> paramsL) // special case for constructor return-type (viz., the class itself)
| None -> retType |> layoutILType denv ilTyparSubst
match parameters with
| [] -> WordL.structUnit ^^ WordL.arrow ^^ res
......
......@@ -484,30 +484,36 @@ module public Microsoft.FSharp.Compiler.PrettyNaming
let [<Literal>] private mangledGenericTypeNameSym = '`'
let IsMangledGenericName (n:string) =
n.IndexOf mangledGenericTypeNameSym <> -1 &&
let TryDemangleGenericNameAndPos (n:string) =
(* check what comes after the symbol is a number *)
let m = n.LastIndexOf mangledGenericTypeNameSym
let mutable res = m < n.Length - 1
for i = m + 1 to n.Length - 1 do
res <- res && n.[i] >= '0' && n.[i] <= '9'
res
let pos = n.LastIndexOf mangledGenericTypeNameSym
if pos = -1 then ValueNone else
let mutable res = pos < n.Length - 1
let mutable i = pos + 1
while res && i < n.Length do
let char = n.[i]
if not (char >= '0' && char <= '9') then
res <- false
i <- i + 1
if res then
ValueSome pos
else
ValueNone
type NameArityPair = NameArityPair of string * int
let DecodeGenericTypeName n =
if IsMangledGenericName n then
let pos = n.LastIndexOf mangledGenericTypeNameSym
let res = n.Substring(0,pos)
let num = n.Substring(pos+1,n.Length - pos - 1)
NameArityPair(res, int32 num)
else NameArityPair(n,0)
let DemangleGenericTypeName n =
if IsMangledGenericName n then
let pos = n.LastIndexOf mangledGenericTypeNameSym
n.Substring(0,pos)
else n
let DecodeGenericTypeName pos (mangledName:string) =
let res = mangledName.Substring(0,pos)
let num = mangledName.Substring(pos+1,mangledName.Length - pos - 1)
NameArityPair(res, int32 num)
let DemangleGenericTypeNameWithPos pos (mangledName:string) =
mangledName.Substring(0,pos)
let DemangleGenericTypeName (mangledName:string) =
match TryDemangleGenericNameAndPos mangledName with
| ValueSome pos -> DemangleGenericTypeNameWithPos pos mangledName
| _ -> mangledName
let private chopStringTo (s:string) (c:char) =
match s.IndexOf c with
......
......@@ -480,10 +480,11 @@ let KeyTyconByDemangledNameAndArity nm (typars: _ list) x =
/// Generic types can be accessed either by 'List' or 'List`1'. This lists both keys. The second form should really be deprecated.
let KeyTyconByAccessNames nm x =
if IsMangledGenericName nm then
let dnm = DemangleGenericTypeName nm
match TryDemangleGenericNameAndPos nm with
| ValueSome pos ->
let dnm = DemangleGenericTypeNameWithPos pos nm
[| KeyValuePair(nm,x); KeyValuePair(dnm,x) |]
else
| _ ->
[| KeyValuePair(nm,x) |]
type ModuleOrNamespaceKind =
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册