From e07ccede16f5d7530265d4ea9050738ea6f207d7 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Thu, 24 Nov 2016 16:51:31 +0100 Subject: [PATCH 1/3] Small cleanup --- src/fsharp/TastOps.fs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/fsharp/TastOps.fs b/src/fsharp/TastOps.fs index 0bbc265a7d3..444538311c7 100644 --- a/src/fsharp/TastOps.fs +++ b/src/fsharp/TastOps.fs @@ -78,15 +78,15 @@ let emptyTyparInst = ([] : TyparInst) [] type Remap = - { tpinst : TyparInst; - valRemap: ValRemap; - tyconRefRemap : TyconRefRemap; + { tpinst : TyparInst + valRemap: ValRemap + tyconRefRemap : TyconRefRemap removeTraitSolutions: bool } let emptyRemap = - { tpinst = emptyTyparInst; - tyconRefRemap = emptyTyconRefRemap; - valRemap = ValMap.Empty; + { tpinst = emptyTyparInst + tyconRefRemap = emptyTyconRefRemap + valRemap = ValMap.Empty removeTraitSolutions = false } type Remap with From eea743c446c59e5220492e344f7c1fa2eece4528 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Thu, 24 Nov 2016 16:49:10 +0100 Subject: [PATCH 2/3] Add type hints --- src/fsharp/CompileOps.fs | 2 +- src/fsharp/TastOps.fs | 2 +- src/fsharp/TcGlobals.fs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fsharp/CompileOps.fs b/src/fsharp/CompileOps.fs index 91dc03a6482..7c953003527 100644 --- a/src/fsharp/CompileOps.fs +++ b/src/fsharp/CompileOps.fs @@ -1491,7 +1491,7 @@ let CollectErrorOrWarning (implicitIncludeDir,showFullPaths,flattenErrors,errorS sprintf "%s(%d,%d,%d,%d): " file m.StartLine m.StartColumn m.EndLine m.EndColumn, m, file else "", m, file - { Range = m; TextRepresentation = text; IsEmpty = false; File = file } + { Range = m; TextRepresentation = text; IsEmpty = false; File = file } : ErrorLocation match err.Exception with | ReportedError _ -> diff --git a/src/fsharp/TastOps.fs b/src/fsharp/TastOps.fs index 444538311c7..9d0e931ff57 100644 --- a/src/fsharp/TastOps.fs +++ b/src/fsharp/TastOps.fs @@ -304,7 +304,7 @@ and remapNonLocalValRef tyenv (nlvref:NonLocalValOrMemberRef) = let vlink' = remapValLinkage tyenv vlink if eref === eref' && vlink === vlink' then nlvref else { EnclosingEntity = eref' - ItemKey = vlink' } + ItemKey = vlink' } : NonLocalValOrMemberRef and remapValRef tmenv (vref: ValRef) = match tmenv.valRemap.TryFind vref.Deref with diff --git a/src/fsharp/TcGlobals.fs b/src/fsharp/TcGlobals.fs index 5931e554bd8..ea756a37b14 100755 --- a/src/fsharp/TcGlobals.fs +++ b/src/fsharp/TcGlobals.fs @@ -750,7 +750,7 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d |> List.filter (fun (_, tcref, _) -> tcref.CanDeref) |> List.map (fun (_, tcref, builder) -> tcref.Stamp, builder) |> Dictionary.ofList - (fun tcref2 tinst -> + (fun (tcref2:EntityRef) tinst -> let dict = dict.Value let key = tcref2.Stamp if dict.ContainsKey key then Some(dict.[key] tinst) From 63337136db722805727f9e1d3471a817846c44a3 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Thu, 24 Nov 2016 16:49:10 +0100 Subject: [PATCH 3/3] Add type hints --- src/fsharp/vs/Symbols.fs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/fsharp/vs/Symbols.fs b/src/fsharp/vs/Symbols.fs index 47e9beecadd..2945a64b596 100644 --- a/src/fsharp/vs/Symbols.fs +++ b/src/fsharp/vs/Symbols.fs @@ -2019,13 +2019,14 @@ and FSharpParameter(cenv, typ:TType, topArgInfo:ArgReprInfo, mOpt, isParamArrayA and FSharpAssemblySignature private (cenv, topAttribs: TypeChecker.TopAttribs option, optViewedCcu: CcuThunk option, mtyp: ModuleOrNamespaceType) = // Assembly signature for a referenced/linked assembly - new (cenv, ccu: CcuThunk) = FSharpAssemblySignature((if ccu.IsUnresolvedReference then cenv else (new cenv(cenv.g, ccu, cenv.tcImports))), None, Some ccu, ccu.Contents.ModuleOrNamespaceType) + new (cenv:cenv, ccu: CcuThunk) = + let cenv = if ccu.IsUnresolvedReference then cenv else (new cenv(cenv.g, ccu, cenv.tcImports)) + FSharpAssemblySignature(cenv, None, Some ccu, ccu.Contents.ModuleOrNamespaceType) // Assembly signature for an assembly produced via type-checking. new (g, thisCcu, tcImports, topAttribs, mtyp) = FSharpAssemblySignature(cenv(g, thisCcu, tcImports), topAttribs, None, mtyp) member __.Entities = - let rec loop (rmtyp : ModuleOrNamespaceType) = [| for entity in rmtyp.AllEntities do if entity.IsNamespace then