From ccdd24d3b53a8577daaaf51594da012188003857 Mon Sep 17 00:00:00 2001 From: Eugene Auduchinok Date: Wed, 15 Oct 2025 14:13:41 +0200 Subject: [PATCH 1/6] Cleanup: remove redundant qualifiers --- src/Compiler/AbstractIL/il.fsi | 14 +- src/Compiler/AbstractIL/ilreflect.fs | 2 +- src/Compiler/AbstractIL/ilwrite.fs | 4 +- src/Compiler/Checking/AttributeChecking.fs | 2 +- src/Compiler/Checking/CheckDeclarations.fs | 4 +- src/Compiler/Checking/CheckFormatStrings.fs | 16 +- src/Compiler/Checking/ConstraintSolver.fs | 2 +- .../CheckComputationExpressions.fs | 4 +- .../Checking/Expressions/CheckExpressions.fs | 14 +- src/Compiler/Checking/InfoReader.fs | 2 +- src/Compiler/Checking/MethodCalls.fs | 30 +- src/Compiler/Checking/MethodCalls.fsi | 8 +- src/Compiler/Checking/PostInferenceChecks.fs | 2 +- src/Compiler/Checking/QuotationTranslator.fs | 154 ++-- src/Compiler/Checking/SignatureHash.fs | 8 +- src/Compiler/Checking/infos.fs | 2 +- src/Compiler/CodeGen/IlxGen.fs | 28 +- src/Compiler/CodeGen/IlxGenSupport.fs | 2 +- src/Compiler/Driver/CompilerConfig.fs | 4 +- src/Compiler/Driver/CompilerDiagnostics.fs | 4 +- src/Compiler/Driver/CompilerOptions.fs | 2 +- .../Driver/GraphChecking/GraphProcessing.fs | 4 +- src/Compiler/Driver/ParseAndCheckInputs.fs | 10 +- src/Compiler/Driver/ParseAndCheckInputs.fsi | 4 +- src/Compiler/Facilities/DiagnosticsLogger.fs | 4 +- src/Compiler/Facilities/Hashing.fs | 10 +- .../Interactive/ControlledExecution.fs | 4 +- src/Compiler/Interactive/fsi.fs | 16 +- src/Compiler/Interactive/fsihelp.fs | 2 +- src/Compiler/Optimize/DetupleArgs.fs | 2 +- .../Optimize/InnerLambdasToTopLevelFuncs.fs | 2 +- src/Compiler/Optimize/Optimizer.fs | 150 ++-- src/Compiler/Service/BackgroundCompiler.fs | 20 +- src/Compiler/Service/FSharpCheckerResults.fs | 2 +- src/Compiler/Service/IncrementalBuild.fsi | 2 +- .../Service/ServiceAssemblyContent.fs | 2 +- .../Service/ServiceDeclarationLists.fs | 94 +-- src/Compiler/Service/ServiceLexing.fs | 2 +- src/Compiler/Service/TransparentCompiler.fs | 4 +- src/Compiler/Service/TransparentCompiler.fsi | 6 +- src/Compiler/SyntaxTree/LexFilter.fs | 2 +- src/Compiler/SyntaxTree/ParseHelpers.fs | 4 +- src/Compiler/SyntaxTree/SyntaxTree.fs | 2 +- src/Compiler/SyntaxTree/SyntaxTree.fsi | 2 +- src/Compiler/SyntaxTree/SyntaxTreeOps.fs | 12 +- src/Compiler/SyntaxTree/SyntaxTreeOps.fsi | 2 +- src/Compiler/SyntaxTree/SyntaxTrivia.fs | 10 +- src/Compiler/TypedTree/CompilerGlobalState.fs | 4 +- src/Compiler/TypedTree/TcGlobals.fs | 4 +- src/Compiler/TypedTree/TcGlobals.fsi | 714 +++++++++--------- src/Compiler/TypedTree/TypeProviders.fs | 6 +- src/Compiler/TypedTree/TypedTree.fs | 14 +- src/Compiler/TypedTree/TypedTree.fsi | 90 +-- src/Compiler/TypedTree/TypedTreeBasics.fs | 6 +- src/Compiler/TypedTree/TypedTreeOps.fs | 38 +- src/FSharp.Core/Linq.fs | 136 ++-- src/FSharp.Core/Linq.fsi | 2 +- src/FSharp.Core/Nullable.fs | 38 +- src/FSharp.Core/Query.fs | 186 ++--- src/FSharp.Core/Query.fsi | 4 +- src/FSharp.Core/QueryExtensions.fs | 2 +- src/FSharp.Core/array.fs | 16 +- src/FSharp.Core/async.fs | 46 +- src/FSharp.Core/async.fsi | 32 +- src/FSharp.Core/event.fs | 28 +- src/FSharp.Core/event.fsi | 4 +- src/FSharp.Core/fslib-extra-pervasives.fs | 20 +- src/FSharp.Core/fslib-extra-pervasives.fsi | 16 +- src/FSharp.Core/list.fs | 16 +- src/FSharp.Core/local.fs | 2 +- src/FSharp.Core/mailbox.fs | 12 +- src/FSharp.Core/map.fs | 14 +- src/FSharp.Core/map.fsi | 2 +- src/FSharp.Core/math/z.fs | 2 +- src/FSharp.Core/observable.fsi | 2 +- src/FSharp.Core/prim-types-prelude.fsi | 44 +- src/FSharp.Core/prim-types.fs | 118 +-- src/FSharp.Core/prim-types.fsi | 34 +- src/FSharp.Core/printf.fs | 26 +- src/FSharp.Core/printf.fsi | 2 +- src/FSharp.Core/quotations.fs | 34 +- src/FSharp.Core/quotations.fsi | 2 +- src/FSharp.Core/reflect.fs | 2 +- src/FSharp.Core/resumable.fs | 2 +- src/FSharp.Core/resumable.fsi | 2 +- src/FSharp.Core/seq.fs | 62 +- src/FSharp.Core/seqcore.fs | 58 +- src/FSharp.Core/seqcore.fsi | 4 +- src/FSharp.Core/set.fs | 16 +- src/FSharp.Core/set.fsi | 4 +- .../BuildGraphTests.fs | 2 +- .../ExprTests.fs | 16 +- .../ProductVersion.fs | 4 +- .../SourceTextTests.fs | 8 +- 94 files changed, 1289 insertions(+), 1289 deletions(-) diff --git a/src/Compiler/AbstractIL/il.fsi b/src/Compiler/AbstractIL/il.fsi index f80c64b0c59..3d6f88bb6ca 100644 --- a/src/Compiler/AbstractIL/il.fsi +++ b/src/Compiler/AbstractIL/il.fsi @@ -111,7 +111,7 @@ type ILAssemblyRef = member EqualsIgnoringVersion: ILAssemblyRef -> bool - interface System.IComparable + interface IComparable [] type ILModuleRef = @@ -123,7 +123,7 @@ type ILModuleRef = member Hash: byte[] option - interface System.IComparable + interface IComparable // Scope references [] @@ -239,7 +239,7 @@ type ILTypeRef = override ToString: unit -> string - interface System.IComparable + interface IComparable /// Type specs and types. [] @@ -267,7 +267,7 @@ type ILTypeSpec = member internal EqualsWithPrimaryScopeRef: ILScopeRef * obj -> bool - interface System.IComparable + interface IComparable [] type ILType = @@ -371,7 +371,7 @@ type ILMethodRef = member GetCallingSignature: unit -> ILCallingSignature - interface System.IComparable + interface IComparable /// Formal identities of fields. [] @@ -403,7 +403,7 @@ type ILMethodSpec = member FormalReturnType: ILType - interface System.IComparable + interface IComparable /// Field specs. The data given for a ldfld, stfld etc. instruction. [] @@ -2490,7 +2490,7 @@ type internal ILPropertyRef = static member Create: ILTypeRef * string -> ILPropertyRef member DeclaringTypeRef: ILTypeRef member Name: string - interface System.IComparable + interface IComparable type ILReferences = { AssemblyReferences: ILAssemblyRef[] diff --git a/src/Compiler/AbstractIL/ilreflect.fs b/src/Compiler/AbstractIL/ilreflect.fs index ca309e95875..b1ee41d012c 100644 --- a/src/Compiler/AbstractIL/ilreflect.fs +++ b/src/Compiler/AbstractIL/ilreflect.fs @@ -550,7 +550,7 @@ let emEnv0 = delayedFieldInits = [] } -let envBindTypeRef emEnv (tref: ILTypeRef) (typT: System.Type MaybeNull, typB, typeDef) = +let envBindTypeRef emEnv (tref: ILTypeRef) (typT: Type MaybeNull, typB, typeDef) = match typT with | Null -> failwithf "binding null type in envBindTypeRef: %s\n" tref.Name | NonNull typT -> diff --git a/src/Compiler/AbstractIL/ilwrite.fs b/src/Compiler/AbstractIL/ilwrite.fs index 1d5111daa50..b1ab074ed63 100644 --- a/src/Compiler/AbstractIL/ilwrite.fs +++ b/src/Compiler/AbstractIL/ilwrite.fs @@ -2623,7 +2623,7 @@ let GenMethodDefSigAsBlobIdx cenv env mdef = GetBytesAsBlobIdx cenv (GetMethodDefSigAsBytes cenv env mdef) let ilMethodBodyThrowNull = - let ilCode = IL.buildILCode "" (Dictionary()) [|ILInstr.AI_ldnull; ILInstr.I_throw|] [] [] + let ilCode = buildILCode "" (Dictionary()) [|ILInstr.AI_ldnull; ILInstr.I_throw|] [] [] mkILMethodBody(false, ILLocals.Empty, 0, ilCode, None, None) let GenMethodDefAsRow cenv env midx (mdef: ILMethodDef) = @@ -4166,7 +4166,7 @@ let writeBinaryAux (stream: Stream, options: options, modul, normalizeAssemblyRe [| hCode hData match options.referenceAssemblyOnly, options.referenceAssemblySignatureHash with - | true, Some impliedSigHash -> System.BitConverter.GetBytes(impliedSigHash) + | true, Some impliedSigHash -> BitConverter.GetBytes(impliedSigHash) | _ -> sha.ComputeHash metadata |] |> Array.collect id |> sha.ComputeHash diff --git a/src/Compiler/Checking/AttributeChecking.fs b/src/Compiler/Checking/AttributeChecking.fs index 8df68aa0e2e..dac14de9498 100755 --- a/src/Compiler/Checking/AttributeChecking.fs +++ b/src/Compiler/Checking/AttributeChecking.fs @@ -76,7 +76,7 @@ let rec private evalFSharpAttribArg g attribExpr = type AttribInfo = | FSAttribInfo of TcGlobals * Attrib - | ILAttribInfo of TcGlobals * Import.ImportMap * ILScopeRef * ILAttribute * range + | ILAttribInfo of TcGlobals * ImportMap * ILScopeRef * ILAttribute * range member x.Range = match x with diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index cbf79fbdfb3..3b6e05f0bdb 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -309,7 +309,7 @@ let AddRootModuleOrNamespaceRefs g amap m env modrefs = /// Adjust the TcEnv to make more things 'InternalsVisibleTo' let addInternalsAccessibility env (ccu: CcuThunk) = - let compPath = CompPath (ccu.ILScopeRef, TypedTree.SyntaxAccess.Unknown, []) + let compPath = CompPath (ccu.ILScopeRef, SyntaxAccess.Unknown, []) let eInternalsVisibleCompPaths = compPath :: env.eInternalsVisibleCompPaths { env with eAccessRights = ComputeAccessRights env.eAccessPath eInternalsVisibleCompPaths env.eFamilyType // update this computed field @@ -1180,7 +1180,7 @@ module MutRecBindingChecking = TyconBindingPhase2A.Phase2AMember { SyntacticBinding = NormalizedBinding(pat = SynPat.Named(ident = SynIdent(ident = Get_OrSet_Ident & setIdent))) RecBindingInfo = RecursiveBindingInfo(vspec = vSet) - } when Range.equals getIdent.idRange setIdent.idRange -> + } when equals getIdent.idRange setIdent.idRange -> match vGet.ApparentEnclosingEntity with | ParentNone -> () | Parent parentRef -> diff --git a/src/Compiler/Checking/CheckFormatStrings.fs b/src/Compiler/Checking/CheckFormatStrings.fs index e0555ef2a79..c7796957982 100644 --- a/src/Compiler/Checking/CheckFormatStrings.fs +++ b/src/Compiler/Checking/CheckFormatStrings.fs @@ -55,7 +55,7 @@ let escapeDotnetFormatString str = // We need to double '{' and '}', because even if they were escaped in the // original string, extra curly braces were stripped away by the F# lexer. |> Seq.collect (fun x -> if x = '{' || x = '}' then [x;x] else [x]) - |> System.String.Concat + |> String.Concat [] let (|PrefixedBy|_|) (prefix: string) (str: string) = @@ -140,13 +140,13 @@ module internal Parse = let rec digitsPrecision (fmt: string) (fmtPos: int) = if fmtPos >= fmt.Length then failwith (FSComp.SR.forBadPrecision()) match fmt[fmtPos] with - | c when System.Char.IsDigit c -> digitsPrecision fmt (fmtPos+1) + | c when Char.IsDigit c -> digitsPrecision fmt (fmtPos+1) | _ -> fmtPos let precision (info: FormatInfoRegister) (fmt: string) (fmtPos: int) = if fmtPos >= fmt.Length then failwith (FSComp.SR.forBadWidth()) match fmt[fmtPos] with - | c when System.Char.IsDigit c -> info.precision <- true; false,digitsPrecision fmt (fmtPos+1) + | c when Char.IsDigit c -> info.precision <- true; false,digitsPrecision fmt (fmtPos+1) | '*' -> info.precision <- true; true,(fmtPos+1) | _ -> failwith (FSComp.SR.forPrecisionMissingAfterDot()) @@ -161,14 +161,14 @@ module internal Parse = let rec go pos n = if pos >= len then failwith (FSComp.SR.forBadPrecision()) match fmt[pos] with - | c when System.Char.IsDigit c -> go (pos+1) (n*10 + int c - int '0') + | c when Char.IsDigit c -> go (pos+1) (n*10 + int c - int '0') | _ -> Some n, optionalDotAndPrecision info fmt pos go fmtPos intAcc let widthAndPrecision (info: FormatInfoRegister) (fmt: string) (fmtPos: int) = if fmtPos >= fmt.Length then failwith (FSComp.SR.forBadPrecision()) match fmt[fmtPos] with - | c when System.Char.IsDigit c -> false,digitsWidthAndPrecision info fmt fmtPos 0 + | c when Char.IsDigit c -> false,digitsWidthAndPrecision info fmt fmtPos 0 | '*' -> true, (None, optionalDotAndPrecision info fmt (fmtPos+1)) | _ -> false, (None, optionalDotAndPrecision info fmt fmtPos) @@ -178,7 +178,7 @@ module internal Parse = let rec digitsPosition n pos = if pos >= len then failwith (FSComp.SR.forBadPrecision()) match fmt[pos] with - | c when System.Char.IsDigit c -> digitsPosition (n*10 + int c - int '0') (pos+1) + | c when Char.IsDigit c -> digitsPosition (n*10 + int c - int '0') (pos+1) | '$' -> Some n, pos+1 | _ -> None, pos @@ -296,7 +296,7 @@ let parseFormatStringInternal else failwith (FSComp.SR.forPositionalSpecifiersNotPermitted()) argTys - elif System.Char.IsSurrogatePair(fmt,i) then + elif Char.IsSurrogatePair(fmt,i) then appendToDotnetFormatString fmt[i..i+1] parseLoop acc (i+2, fragLine, fragCol+2) fragments else @@ -397,7 +397,7 @@ let parseFormatStringInternal let ch = fmt[i] match ch with | 'd' | 'i' | 'u' | 'B' | 'o' | 'x' | 'X' -> - if ch = 'B' then DiagnosticsLogger.checkLanguageFeatureError g.langVersion Features.LanguageFeature.PrintfBinaryFormat m + if ch = 'B' then checkLanguageFeatureError g.langVersion Features.LanguageFeature.PrintfBinaryFormat m if info.precision then failwith (FSComp.SR.forFormatDoesntSupportPrecision(ch.ToString())) collectSpecifierLocation fragLine fragCol 1 let i = skipPossibleInterpolationHole (i+1) diff --git a/src/Compiler/Checking/ConstraintSolver.fs b/src/Compiler/Checking/ConstraintSolver.fs index a8389e6ad05..7f4697daee3 100644 --- a/src/Compiler/Checking/ConstraintSolver.fs +++ b/src/Compiler/Checking/ConstraintSolver.fs @@ -80,7 +80,7 @@ open FSharp.Compiler.TypeProviders // of the constraint resolution carried out by type checking. //------------------------------------------------------------------------- -let compgenId = mkSynId Range.range0 unassignedTyparName +let compgenId = mkSynId range0 unassignedTyparName let NewCompGenTypar (kind, rigid, staticReq, dynamicReq, error) = Construct.NewTypar(kind, rigid, SynTypar(compgenId, staticReq, true), error, dynamicReq, [], false, false) diff --git a/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs b/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs index 1f31414599d..72cd0767755 100644 --- a/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs +++ b/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs @@ -1381,7 +1381,7 @@ let rec TryTranslateComputationExpression let condBinding = mkSynBinding - (Xml.PreXmlDoc.Empty, patCond) + (PreXmlDoc.Empty, patCond) (None, false, true, @@ -1545,7 +1545,7 @@ let rec TryTranslateComputationExpression // and so we use a more specific error message for clarity. | SynExpr.Const(SynConst.Unit, mUnit) when cenv.g.langVersion.SupportsFeature LanguageFeature.EmptyBodiedComputationExpressions - && Range.equals mUnit range0 + && equals mUnit range0 -> error (Error(FSComp.SR.tcEmptyBodyRequiresBuilderZeroMethod (), ceenv.mWhole)) | _ -> error (Error(FSComp.SR.tcRequireBuilderMethod ("Zero"), m)) diff --git a/src/Compiler/Checking/Expressions/CheckExpressions.fs b/src/Compiler/Checking/Expressions/CheckExpressions.fs index 92391651740..44034ab2a6f 100644 --- a/src/Compiler/Checking/Expressions/CheckExpressions.fs +++ b/src/Compiler/Checking/Expressions/CheckExpressions.fs @@ -4967,7 +4967,7 @@ and CrackStaticConstantArgs (cenv: cenv) env tpenv (staticParameters: Tainted Array.mapi (fun i sp -> - let spKind = Import.ImportProvidedType cenv.amap m (sp.PApply((fun x -> x.ParameterType), m)) + let spKind = ImportProvidedType cenv.amap m (sp.PApply((fun x -> x.ParameterType), m)) let spName = sp.PUntaint((fun sp -> sp.Name), m) if i < unnamedArgs.Length then let v = unnamedArgs[i] @@ -5050,7 +5050,7 @@ and TcProvidedTypeApp (cenv: cenv) env tpenv tcref args m = if hasNoArgs then mkWoNullAppTy tcref [], tpenv else - let ty = Import.ImportProvidedType cenv.amap m providedTypeAfterStaticArguments + let ty = ImportProvidedType cenv.amap m providedTypeAfterStaticArguments ty, tpenv #endif @@ -6603,11 +6603,11 @@ and ExpandIndexArgs (cenv: cenv) (synLeftExprOpt: SynExpr option) indexArgs = let mkSynSomeExpr (m: range) x = let m = m.MakeSynthetic() - SynExpr.App (ExprAtomicFlag.NonAtomic, false, mkSynLidGet m FSharpLib.CorePath "Some", x, m) + SynExpr.App (ExprAtomicFlag.NonAtomic, false, mkSynLidGet m CorePath "Some", x, m) let mkSynNoneExpr (m: range) = let m = m.MakeSynthetic() - mkSynLidGet m FSharpLib.CorePath "None" + mkSynLidGet m CorePath "None" let expandedIndexArgs = indexArgs @@ -10445,7 +10445,7 @@ and TcSetterArgExpr (cenv: cenv) env denv objExpr ad assignedSetter calledFromCo MethInfoChecks g cenv.amap true None [objExpr] ad m pminfo let calledArgTy = List.head (List.head (pminfo.GetParamTypes(cenv.amap, m, pminst))) let tcVal = LightweightTcValForUsingInBuildMethodCall g - let argExprPrebinder, argExpr = MethodCalls.AdjustCallerArgExpr tcVal g cenv.amap cenv.infoReader ad false calledArgTy ReflectedArgInfo.None callerArgTy m argExpr + let argExprPrebinder, argExpr = AdjustCallerArgExpr tcVal g cenv.amap cenv.infoReader ad false calledArgTy ReflectedArgInfo.None callerArgTy m argExpr let mut = (if isStructTy g (tyOfExpr g objExpr) then DefinitelyMutates else PossiblyMutates) let action = BuildPossiblyConditionalMethodCall cenv env mut m true pminfo NormalValUse pminst [objExpr] [argExpr] propStaticTyOpt |> fst argExprPrebinder, action, Item.Property (pinfo.PropertyName, [pinfo], None) @@ -10455,7 +10455,7 @@ and TcSetterArgExpr (cenv: cenv) env denv objExpr ad assignedSetter calledFromCo ILFieldInstanceChecks g cenv.amap ad m finfo let calledArgTy = finfo.FieldType (cenv.amap, m) let tcVal = LightweightTcValForUsingInBuildMethodCall g - let argExprPrebinder, argExpr = MethodCalls.AdjustCallerArgExpr tcVal g cenv.amap cenv.infoReader ad false calledArgTy ReflectedArgInfo.None callerArgTy m argExpr + let argExprPrebinder, argExpr = AdjustCallerArgExpr tcVal g cenv.amap cenv.infoReader ad false calledArgTy ReflectedArgInfo.None callerArgTy m argExpr let action = BuildILFieldSet g m objExpr finfo argExpr argExprPrebinder, action, Item.ILField finfo @@ -10464,7 +10464,7 @@ and TcSetterArgExpr (cenv: cenv) env denv objExpr ad assignedSetter calledFromCo let calledArgTy = rfinfo.FieldType CheckRecdFieldMutation m denv rfinfo let tcVal = LightweightTcValForUsingInBuildMethodCall g - let argExprPrebinder, argExpr = MethodCalls.AdjustCallerArgExpr tcVal g cenv.amap cenv.infoReader ad false calledArgTy ReflectedArgInfo.None callerArgTy m argExpr + let argExprPrebinder, argExpr = AdjustCallerArgExpr tcVal g cenv.amap cenv.infoReader ad false calledArgTy ReflectedArgInfo.None callerArgTy m argExpr let action = BuildRecdFieldSet g m objExpr rfinfo argExpr argExprPrebinder, action, Item.RecdField rfinfo diff --git a/src/Compiler/Checking/InfoReader.fs b/src/Compiler/Checking/InfoReader.fs index 6a17b25136e..861152703b1 100644 --- a/src/Compiler/Checking/InfoReader.fs +++ b/src/Compiler/Checking/InfoReader.fs @@ -352,7 +352,7 @@ type private IndexedList<'T>(itemLists: 'T list list, itemsByName: NameMultiMap< /// An InfoReader is an object to help us read and cache infos. /// We create one of these for each file we typecheck. -type InfoReader(g: TcGlobals, amap: Import.ImportMap) as this = +type InfoReader(g: TcGlobals, amap: ImportMap) as this = /// Get the declared IL fields of a type, not including inherited fields let GetImmediateIntrinsicILFieldsOfType (optFilter, ad) m ty = diff --git a/src/Compiler/Checking/MethodCalls.fs b/src/Compiler/Checking/MethodCalls.fs index 18c74326333..85c65fafeae 100644 --- a/src/Compiler/Checking/MethodCalls.fs +++ b/src/Compiler/Checking/MethodCalls.fs @@ -1107,7 +1107,7 @@ let rec MakeMethInfoCall (amap: ImportMap) m (minfo: MethInfo) minst args static #if !NO_TYPEPROVIDERS | ProvidedMeth(amap, mi, _, m) -> let isProp = false // not necessarily correct, but this is only used post-creflect where this flag is irrelevant - let ilMethodRef = Import.ImportProvidedMethodBaseAsILMethodRef amap m mi + let ilMethodRef = ImportProvidedMethodBaseAsILMethodRef amap m mi let isConstructor = mi.PUntaint((fun c -> c.IsConstructor), m) let isStruct = mi.PUntaint((fun c -> (nonNull c.DeclaringType).IsValueType), m) let actualTypeInst = [] // GENERIC TYPE PROVIDERS: for generics, we would have something here @@ -1120,9 +1120,9 @@ let rec MakeMethInfoCall (amap: ImportMap) m (minfo: MethInfo) minst args static #if !NO_TYPEPROVIDERS // This imports a provided method, and checks if it is a known compiler intrinsic like "1 + 2" -let TryImportProvidedMethodBaseAsLibraryIntrinsic (amap: Import.ImportMap, m: range, mbase: Tainted) = +let TryImportProvidedMethodBaseAsLibraryIntrinsic (amap: ImportMap, m: range, mbase: Tainted) = let methodName = mbase.PUntaint((fun x -> x.Name), m) - let declaringType = Import.ImportProvidedType amap m (mbase.PApply((fun x -> nonNull x.DeclaringType), m)) + let declaringType = ImportProvidedType amap m (mbase.PApply((fun x -> nonNull x.DeclaringType), m)) match tryTcrefOfAppTy amap.g declaringType with | ValueSome declaringEntity -> if not declaringEntity.IsLocalRef && ccuEq declaringEntity.nlr.Ccu amap.g.fslibCcu then @@ -1197,7 +1197,7 @@ let rec BuildMethodCall tcVal g amap isMutable m isProp minfo valUseFlags minst let vExpr, vExprTy = tcVal fsValRef valUseFlags (minfo.DeclaringTypeInst @ minst) m BuildFSharpMethodApp g m fsValRef vExpr vExprTy allArgs | None -> - let ilMethRef = Import.ImportProvidedMethodBaseAsILMethodRef amap m providedMeth + let ilMethRef = ImportProvidedMethodBaseAsILMethodRef amap m providedMeth let isNewObj = isCtor && (match valUseFlags with NormalValUse -> true | _ -> false) let actualTypeInst = if isRefTupleTy g enclTy then argsOfAppTy g (mkCompiledTupleTy g false (destRefTupleTy g enclTy)) // provided expressions can include method calls that get properties of tuple types @@ -1779,7 +1779,7 @@ module ProvidedMethodCalls = let private convertConstExpr g amap m (constant : Tainted) = let obj, objTy = constant.PApply2(id, m) - let ty = Import.ImportProvidedType amap m objTy + let ty = ImportProvidedType amap m objTy let normTy = normalizeEnumTy g ty obj.PUntaint((fun v -> let fail() = raise (TypeProviderError(FSComp.SR.etUnsupportedConstantType(v.GetType().ToString()), constant.TypeProviderDesignation, m)) @@ -1836,7 +1836,7 @@ module ProvidedMethodCalls = let isGeneric = st.PUntaint((fun st -> st.IsGenericType), m) let headType = if isGeneric then st.PApply((fun st -> st.GetGenericTypeDefinition()), m) else st // We import in order to use IsProvidedErasedTycon, to make sure we at least don't reinvent that - let headTypeAsFSharpType = Import.ImportProvidedNamedType amap m headType + let headTypeAsFSharpType = ImportProvidedNamedType amap m headType if headTypeAsFSharpType.IsProvidedErasedTycon then let baseType = st.PApply((fun st -> @@ -1892,14 +1892,14 @@ module ProvidedMethodCalls = | ProvidedTypeAsExpr (expr, targetTy) -> let expr, targetTy = exprType.PApply2((fun _ -> (expr, targetTy)), m) let srcExpr = exprToExpr expr - let targetTy = Import.ImportProvidedType amap m (targetTy.PApply(id, m)) - let sourceTy = Import.ImportProvidedType amap m (expr.PApply ((fun e -> e.Type), m)) + let targetTy = ImportProvidedType amap m (targetTy.PApply(id, m)) + let sourceTy = ImportProvidedType amap m (expr.PApply ((fun e -> e.Type), m)) let exprR = mkCoerceIfNeeded g targetTy sourceTy srcExpr None, (exprR, tyOfExpr g exprR) | ProvidedTypeTestExpr (expr, targetTy) -> let expr, targetTy = exprType.PApply2((fun _ -> (expr, targetTy)), m) let srcExpr = exprToExpr expr - let targetTy = Import.ImportProvidedType amap m (targetTy.PApply(id, m)) + let targetTy = ImportProvidedType amap m (targetTy.PApply(id, m)) let exprR = mkCallTypeTest g m targetTy srcExpr None, (exprR, tyOfExpr g exprR) | ProvidedIfThenElseExpr (test, thenBranch, elseBranch) -> @@ -1922,7 +1922,7 @@ module ProvidedMethodCalls = None, (exprR, tyOfExpr g exprR) | ProvidedNewArrayExpr (ty, elems) -> let ty, elems = exprType.PApply2((fun _ -> (ty, elems)), m) - let tyR = Import.ImportProvidedType amap m ty + let tyR = ImportProvidedType amap m ty let elems = elems.PApplyArray(id, "GetInvokerExpression", m) let elemsR = elems |> Array.map exprToExpr |> Array.toList let exprR = Expr.Op (TOp.Array, [tyR], elemsR, m) @@ -1979,7 +1979,7 @@ module ProvidedMethodCalls = None, (exprR, tyOfExpr g exprR) | ProvidedNewDelegateExpr (delegateTy, boundVars, delegateBodyExpr) -> let delegateTy, boundVars, delegateBodyExpr = exprType.PApply3((fun _ -> (delegateTy, boundVars, delegateBodyExpr)), m) - let delegateTyR = Import.ImportProvidedType amap m delegateTy + let delegateTyR = ImportProvidedType amap m delegateTy let vs = boundVars.PApplyArray(id, "GetInvokerExpression", m) |> Array.toList let vsT = List.map addVar vs let delegateBodyExprR = exprToExpr delegateBodyExpr @@ -1990,7 +1990,7 @@ module ProvidedMethodCalls = let exprR = CoerceFromFSharpFuncToDelegate g amap infoReader AccessorDomain.AccessibleFromSomewhere lambdaExprTy m lambdaExpr delegateTyR None, (exprR, tyOfExpr g exprR) | ProvidedDefaultExpr pty -> - let ty = Import.ImportProvidedType amap m (exprType.PApply((fun _ -> pty), m)) + let ty = ImportProvidedType amap m (exprType.PApply((fun _ -> pty), m)) let exprR = mkDefault (m, ty) None, (exprR, tyOfExpr g exprR) | ProvidedCallExpr (e1, e2, e3) -> @@ -2036,7 +2036,7 @@ module ProvidedMethodCalls = let nm = v.PUntaint ((fun v -> v.Name), m) let mut = v.PUntaint ((fun v -> v.IsMutable), m) let vRaw = v.PUntaint (id, m) - let tyR = Import.ImportProvidedType amap m (v.PApply ((fun v -> v.Type), m)) + let tyR = ImportProvidedType amap m (v.PApply ((fun v -> v.Type), m)) let vR, vTe = if mut then mkMutableCompGenLocal m nm tyR else mkCompGenLocal m nm tyR varConv[vRaw] <- (Some vR, vTe) vR @@ -2059,7 +2059,7 @@ module ProvidedMethodCalls = meth.PApplyArray((fun m -> m.GetGenericArguments()), "GetGenericArguments", m) else [| |] - let replacementGenericArguments = genericArguments |> Array.map (fun t->Import.ImportProvidedType amap m t) |> List.ofArray + let replacementGenericArguments = genericArguments |> Array.map (fun t->ImportProvidedType amap m t) |> List.ofArray let mut = if top then mut else PossiblyMutates let isSuperInit = if top then isSuperInit else ValUseFlag.NormalValUse @@ -2169,7 +2169,7 @@ let GenWitnessExpr amap g m (traitInfo: TraitConstraintInfo) argExprs = match extOpt with | None -> MethInfo.CreateILMeth(amap, m, origTy, mdef) | Some ilActualTypeRef -> - let actualTyconRef = Import.ImportILTypeRef amap m ilActualTypeRef + let actualTyconRef = ImportILTypeRef amap m ilActualTypeRef MethInfo.CreateILExtensionMeth(amap, m, origTy, actualTyconRef, None, mdef) Choice1Of5 (ilMethInfo, minst, staticTyOpt) diff --git a/src/Compiler/Checking/MethodCalls.fsi b/src/Compiler/Checking/MethodCalls.fsi index f167fbe3b03..1a62bbe01bd 100644 --- a/src/Compiler/Checking/MethodCalls.fsi +++ b/src/Compiler/Checking/MethodCalls.fsi @@ -363,7 +363,7 @@ val BuildMethodCall: tcVal: (ValRef -> ValUseFlag -> TType list -> range -> Expr * TType) -> g: TcGlobals -> amap: ImportMap -> - isMutable: TypedTreeOps.Mutates -> + isMutable: Mutates -> m: range -> isProp: bool -> minfo: MethInfo -> @@ -477,9 +477,9 @@ val MethInfoChecks: minfo: MethInfo -> unit -exception FieldNotMutable of TypedTreeOps.DisplayEnv * RecdFieldRef * range +exception FieldNotMutable of DisplayEnv * RecdFieldRef * range -val CheckRecdFieldMutation: m: range -> denv: TypedTreeOps.DisplayEnv -> rfinfo: RecdFieldInfo -> unit +val CheckRecdFieldMutation: m: range -> denv: DisplayEnv -> rfinfo: RecdFieldInfo -> unit /// Generate a witness for the given (solved) constraint. Five possibilities are taken /// into account. @@ -517,7 +517,7 @@ module ProvidedMethodCalls = amap: ImportMap * mi: Tainted * objArgs: Expr list * - mut: TypedTreeOps.Mutates * + mut: Mutates * isProp: bool * isSuperInit: ValUseFlag * allArgs: Exprs * diff --git a/src/Compiler/Checking/PostInferenceChecks.fs b/src/Compiler/Checking/PostInferenceChecks.fs index d72f21662b3..1aadec93456 100644 --- a/src/Compiler/Checking/PostInferenceChecks.fs +++ b/src/Compiler/Checking/PostInferenceChecks.fs @@ -201,7 +201,7 @@ type cenv = g: TcGlobals - amap: Import.ImportMap + amap: ImportMap /// For reading metadata infoReader: InfoReader diff --git a/src/Compiler/Checking/QuotationTranslator.fs b/src/Compiler/Checking/QuotationTranslator.fs index cfe98e4ac7d..ed37c3ba46f 100644 --- a/src/Compiler/Checking/QuotationTranslator.fs +++ b/src/Compiler/Checking/QuotationTranslator.fs @@ -216,7 +216,7 @@ let (|ObjectInitializationCheck|_|) g expr = let rec EmitDebugInfoIfNecessary cenv env (m: range) astExpr : ExprData = // do not emit debug info if emitDebugInfoInQuotations = false or it was already written for the given expression - if cenv.emitDebugInfoInQuotations && not (QP.isAttributedExpression astExpr) then + if cenv.emitDebugInfoInQuotations && not (isAttributedExpression astExpr) then cenv.emitDebugInfoInQuotations <- false try let mk_tuple g m es = mkRefTupled g m es (List.map (tyOfExpr g) es) @@ -236,7 +236,7 @@ let rec EmitDebugInfoIfNecessary cenv env (m: range) astExpr : ExprData = let attrExprR = ConvExprCore cenv env attrExpr - QP.mkAttributedExpression(astExpr, attrExprR) + mkAttributedExpression(astExpr, attrExprR) finally cenv.emitDebugInfoInQuotations <- true else @@ -269,7 +269,7 @@ and ConvWitnessInfo cenv env m traitInfo = match env.witnessesInScope.TryGetValue witnessInfo with | true, witnessesInScopeValue -> let witnessArgIdx = witnessesInScopeValue - QP.mkVar witnessArgIdx + mkVar witnessArgIdx // Otherwise it is a witness in a quotation literal | false, _ -> let holeTy = GenWitnessTy g witnessInfo @@ -277,9 +277,9 @@ and ConvWitnessInfo cenv env m traitInfo = let fillExpr = Expr.WitnessArg(traitInfo, m) let liftExpr = mkCallLiftValue cenv.g m holeTy fillExpr cenv.exprSplices.Add((liftExpr, m)) - QP.mkHole(ConvType cenv env m holeTy, idx) + mkHole(ConvType cenv env m holeTy, idx) -and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP.ExprData = +and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : ExprData = let g = cenv.g @@ -306,8 +306,8 @@ and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP. | None -> () cenv.exprSplices.Add((x0, m)) - let hole = QP.mkHole(ConvType cenv env m ty, idx) - (hole, rest) ||> List.fold (fun fR arg -> QP.mkApp (fR, ConvExpr cenv env arg)) + let hole = mkHole(ConvType cenv env m ty, idx) + (hole, rest) ||> List.fold (fun fR arg -> mkApp (fR, ConvExpr cenv env arg)) | ModuleValueOrMemberUse g (vref, vFlags, _f, _fTy, tyargs, curriedArgs) when not (g.isSpliceOperator vref) -> @@ -420,7 +420,7 @@ and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP. QP.mkSequential(argQ, subCall) | _ -> subCall - List.fold (fun fR arg -> QP.mkApp (fR, ConvExpr cenv env arg)) callR laterArgs + List.fold (fun fR arg -> mkApp (fR, ConvExpr cenv env arg)) callR laterArgs // Blast type application nodes and expression application nodes apart so values are left with just their type arguments | Expr.App (f, fTy, (_ :: _ as tyargs), (_ :: _ as args), m) -> @@ -434,7 +434,7 @@ and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP. // Simple applications | Expr.App (f, _fTy, tyargs, args, m) -> if not (List.isEmpty tyargs) then wfail(Error(FSComp.SR.crefQuotationsCantContainGenericExprs(), m)) - List.fold (fun fR arg -> QP.mkApp (fR, ConvExpr cenv env arg)) (ConvExpr cenv env f) args + List.fold (fun fR arg -> mkApp (fR, ConvExpr cenv env arg)) (ConvExpr cenv env f) args // REVIEW: what is the quotation view of literals accessing enumerations? Currently they show up as integers. | Expr.Const (c, m, ty) -> @@ -455,7 +455,7 @@ and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP. let env = BindFlatVals env vs let bodyR = ConvExpr cenv env body let bindsR = List.zip vsR (binds |> List.map (fun b -> ConvExpr cenv env b.Expr)) - QP.mkLetRec(bindsR, bodyR) + mkLetRec(bindsR, bodyR) | Expr.Lambda (_, _, _, vs, b, _, _) -> let v, b = MultiLambdaToTupledLambda g vs b @@ -469,9 +469,9 @@ and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP. // Look for a 'raw' quotation tyconRefEq g (tcrefOfAppTy g ety) g.raw_expr_tcr then - QP.mkQuoteRaw40(ConvExpr cenv env ast) + mkQuoteRaw40(ConvExpr cenv env ast) else - QP.mkQuote(ConvExpr cenv env ast) + mkQuote(ConvExpr cenv env ast) | Expr.TyLambda (_, _, _, m, _) -> wfail(Error(FSComp.SR.crefQuotationsCantContainGenericFunctions(), m)) @@ -490,7 +490,7 @@ and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP. let f = mkLambdas g m tps tmvs (e, GetFSharpViewOfReturnType g (returnTyOfMethod g tmethod)) let fR = ConvExpr cenv env f let tyargR = ConvType cenv env m ctyp - QP.mkDelegate(tyargR, fR) + mkDelegate(tyargR, fR) | Expr.StaticOptimization (_, _, x, _) -> ConvExpr cenv env x @@ -510,32 +510,32 @@ and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP. let tcR, s = ConvUnionCaseRef cenv ucref m let tyargsR = ConvTypes cenv env m tyargs let argsR = ConvExprs cenv env args - QP.mkUnion(tcR, s, tyargsR, argsR) + mkUnion(tcR, s, tyargsR, argsR) | TOp.Tuple tupInfo, tyargs, _ -> let tyR = ConvType cenv env m (mkAnyTupledTy g tupInfo tyargs) let argsR = ConvExprs cenv env args - QP.mkTuple(tyR, argsR) + mkTuple(tyR, argsR) | TOp.Recd (_, tcref), _, _ -> let rgtypR = ConvTyconRef cenv tcref m let tyargsR = ConvTypes cenv env m tyargs let argsR = ConvExprs cenv env args - QP.mkRecdMk(rgtypR, tyargsR, argsR) + mkRecdMk(rgtypR, tyargsR, argsR) | TOp.AnonRecd anonInfo, _, _ -> let tref = anonInfo.ILTypeRef let rgtypR = ConvILTypeRef cenv tref let tyargsR = ConvTypes cenv env m tyargs let argsR = ConvExprs cenv env args - QP.mkRecdMk(rgtypR, tyargsR, argsR) + mkRecdMk(rgtypR, tyargsR, argsR) | TOp.AnonRecdGet (anonInfo, n), _, _ -> let tref = anonInfo.ILTypeRef let rgtypR = ConvILTypeRef cenv tref let tyargsR = ConvTypes cenv env m tyargs let argsR = ConvExprs cenv env args - QP.mkRecdGet(rgtypR, anonInfo.SortedNames[n], tyargsR, argsR) + mkRecdGet(rgtypR, anonInfo.SortedNames[n], tyargsR, argsR) | TOp.UnionCaseFieldGet (ucref, n), tyargs, [e] -> ConvUnionFieldGet cenv env m ucref n tyargs e @@ -555,7 +555,7 @@ and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP. | TOp.TupleFieldGet (tupInfo, n), tyargs, [e] -> let eR = ConvLValueExpr cenv env e let tyR = ConvType cenv env m (mkAnyTupledTy g tupInfo tyargs) - QP.mkTupleGet(tyR, n, eR) + mkTupleGet(tyR, n, eR) | TOp.ILAsm (([ I_ldfld (_, _, fspec) ] | [ I_ldfld (_, _, fspec); AI_nop ] @@ -567,7 +567,7 @@ and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP. let tyargsR = ConvTypes cenv env m enclTypeArgs let parentTyconR = ConvILTypeRefUnadjusted cenv m fspec.DeclaringTypeRef let argsR = ConvLValueArgs cenv env args - QP.mkFieldSet(parentTyconR, fspec.Name, tyargsR, argsR) + mkFieldSet(parentTyconR, fspec.Name, tyargsR, argsR) | TOp.ILAsm ([ AI_ceq ], _), _, [arg1;arg2] -> let ty = tyOfExpr g arg1 @@ -593,24 +593,24 @@ and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP. ArgTypes = methArgTypesR }, [], argsR) let exnTypeR = ConvType cenv env m g.exn_ty - QP.mkCoerce(exnTypeR, objR) + mkCoerce(exnTypeR, objR) | TOp.ValFieldSet rfref, _tinst, args -> let argsR = ConvLValueArgs cenv env args let tyargsR = ConvTypes cenv env m tyargs let parentTyconR, fldOrPropName = ConvRecdFieldRef cenv rfref m if rfref.TyconRef.IsRecordTycon then - QP.mkRecdSet(parentTyconR, fldOrPropName, tyargsR, argsR) + mkRecdSet(parentTyconR, fldOrPropName, tyargsR, argsR) else let fspec = rfref.RecdField let tcref = rfref.TyconRef let parentTyconR = ConvTyconRef cenv tcref m if useGenuineField tcref.Deref fspec then - QP.mkFieldSet(parentTyconR, fldOrPropName, tyargsR, argsR) + mkFieldSet(parentTyconR, fldOrPropName, tyargsR, argsR) else let envinner = BindFormalTypars env tcref.TyparsNoRange let propRetTypeR = ConvType cenv envinner m fspec.FormalType - QP.mkPropSet( (parentTyconR, fldOrPropName, propRetTypeR, []), tyargsR, argsR) + mkPropSet( (parentTyconR, fldOrPropName, propRetTypeR, []), tyargsR, argsR) | TOp.ExnFieldGet (tcref, i), [], [obj] -> let exnc = stripExnEqns tcref @@ -619,24 +619,24 @@ and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP. let propRetTypeR = ConvType cenv env m fspec.FormalType let callArgR = ConvExpr cenv env obj let exnTypeR = ConvType cenv env m (generalizedTyconRef g tcref) - QP.mkPropGet( (parentTyconR, fspec.LogicalName, propRetTypeR, []), [], [QP.mkCoerce (exnTypeR, callArgR)]) + mkPropGet( (parentTyconR, fspec.LogicalName, propRetTypeR, []), [], [mkCoerce (exnTypeR, callArgR)]) | TOp.Coerce, [tgtTy;srcTy], [x] -> let xR = ConvExpr cenv env x if typeEquiv g tgtTy srcTy then xR else - QP.mkCoerce(ConvType cenv env m tgtTy, xR) + mkCoerce(ConvType cenv env m tgtTy, xR) | TOp.Reraise, [toTy], [] -> // rebuild reraise() and Convert mkReraiseLibCall g toTy m |> ConvExpr cenv env | TOp.LValueOp (LAddrOf _, vref), [], [] -> - QP.mkAddressOf(ConvValRef false cenv env m vref []) + mkAddressOf(ConvValRef false cenv env m vref []) | TOp.LValueOp (LByrefSet, vref), [], [e] -> - QP.mkAddressSet(ConvValRef false cenv env m vref [], ConvExpr cenv env e) + mkAddressSet(ConvValRef false cenv env m vref [], ConvExpr cenv env e) | TOp.LValueOp (LSet, vref), [], [e] -> // Sets of module values become property sets @@ -645,18 +645,18 @@ and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP. let parentTyconR = ConvTyconRef cenv tcref m let propName = vref.CompiledName g.CompilerGlobalState let propTy = ConvType cenv env m vref.Type - QP.mkPropSet( (parentTyconR, propName, propTy, []), [], [ConvExpr cenv env e]) + mkPropSet( (parentTyconR, propName, propTy, []), [], [ConvExpr cenv env e]) | _ -> - QP.mkVarSet( ConvValRef false cenv env m vref [], ConvExpr cenv env e) + mkVarSet( ConvValRef false cenv env m vref [], ConvExpr cenv env e) | TOp.LValueOp (LByrefGet, vref), [], [] -> ConvValRef false cenv env m vref [] | TOp.Array, [ty], xa -> - QP.mkNewArray(ConvType cenv env m ty, ConvExprs cenv env xa) + mkNewArray(ConvType cenv env m ty, ConvExprs cenv env xa) | TOp.While _, [], [Expr.Lambda (_, _, _, [_], test, _, _);Expr.Lambda (_, _, _, [_], body, _, _)] -> - QP.mkWhileLoop(ConvExpr cenv env test, ConvExpr cenv env body) + mkWhileLoop(ConvExpr cenv env test, ConvExpr cenv env body) | TOp.IntegerForLoop (_, _, FSharpForLoopUp), [], [Expr.Lambda (_, _, _, [_], lim0, _, _); Expr.Lambda (_, _, _, [_], SimpleArrayLoopUpperBound, lm, _); SimpleArrayLoopBody g (arr, elemTy, body)] -> let lim1 = @@ -726,10 +726,10 @@ and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP. match witnessArgInfo with | Some witnessArgIdx -> - let witnessR = QP.mkVar witnessArgIdx + let witnessR = mkVar witnessArgIdx let args = if List.isEmpty args then [ mkUnit g m ] else args let argsR = ConvExprs cenv env args - (witnessR, argsR) ||> List.fold (fun fR argR -> QP.mkApp (fR, argR)) + (witnessR, argsR) ||> List.fold (fun fR argR -> mkApp (fR, argR)) | None -> // If witnesses are available, we should now always find trait witnesses in scope @@ -762,13 +762,13 @@ and ConvLdfld cenv env m (fspec: ILFieldSpec) enclTypeArgs args = let tyargsR = ConvTypes cenv env m enclTypeArgs let parentTyconR = ConvILTypeRefUnadjusted cenv m fspec.DeclaringTypeRef let argsR = ConvLValueArgs cenv env args - QP.mkFieldGet(parentTyconR, fspec.Name, tyargsR, argsR) + mkFieldGet(parentTyconR, fspec.Name, tyargsR, argsR) and ConvUnionFieldGet cenv env m ucref n tyargs e = let tyargsR = ConvTypes cenv env m tyargs let tcR, s = ConvUnionCaseRef cenv ucref m let eR = ConvLValueExpr cenv env e - QP.mkUnionFieldGet(tcR, s, n, tyargsR, eR) + mkUnionFieldGet(tcR, s, n, tyargsR, eR) and ConvClassOrRecdFieldGet cenv env m rfref tyargs args = EmitDebugInfoIfNecessary cenv env m (ConvClassOrRecdFieldGetCore cenv env m rfref tyargs args) @@ -778,16 +778,16 @@ and private ConvClassOrRecdFieldGetCore cenv env m rfref tyargs args = let argsR = ConvLValueArgs cenv env args let parentTyconR, fldOrPropName = ConvRecdFieldRef cenv rfref m if rfref.TyconRef.IsRecordTycon then - QP.mkRecdGet(parentTyconR, fldOrPropName, tyargsR, argsR) + mkRecdGet(parentTyconR, fldOrPropName, tyargsR, argsR) else let fspec = rfref.RecdField let tcref = rfref.TyconRef if useGenuineField tcref.Deref fspec then - QP.mkFieldGet(parentTyconR, fldOrPropName, tyargsR, argsR) + mkFieldGet(parentTyconR, fldOrPropName, tyargsR, argsR) else let envinner = BindFormalTypars env tcref.TyparsNoRange let propRetTypeR = ConvType cenv envinner m fspec.FormalType - QP.mkPropGet( (parentTyconR, fldOrPropName, propRetTypeR, []), tyargsR, argsR) + mkPropGet( (parentTyconR, fldOrPropName, propRetTypeR, []), tyargsR, argsR) and ConvLetBind cenv env (bind : Binding) = match bind.Expr with @@ -859,33 +859,33 @@ and ConvObjectModelCallCore cenv env m (isPropGet, isPropSet, isNewObj, parentTy assert witnessArgTypesR.IsEmpty let propName = ChopPropertyName methName if isPropGet then - QP.mkPropGet((parentTyconR, propName, methRetTypeR, methArgTypesR), tyargsR, allArgsR) + mkPropGet((parentTyconR, propName, methRetTypeR, methArgTypesR), tyargsR, allArgsR) else let args, propTy = List.frontAndBack methArgTypesR - QP.mkPropSet((parentTyconR, propName, propTy, args), tyargsR, allArgsR) + mkPropSet((parentTyconR, propName, propTy, args), tyargsR, allArgsR) elif isNewObj then assert witnessArgTypesR.IsEmpty - let ctorR : QuotationPickler.CtorData = + let ctorR : CtorData = { Parent = parentTyconR ArgTypes = methArgTypesR } - QP.mkCtorCall(ctorR, tyargsR, allArgsR) + mkCtorCall(ctorR, tyargsR, allArgsR) elif witnessArgTypesR.IsEmpty then - let methR : QuotationPickler.MethodData = + let methR : MethodData = { Parent = parentTyconR ArgTypes = methArgTypesR RetType = methRetTypeR Name = methName NumGenericArgs = numGenericArgs } - QP.mkMethodCall(methR, tyargsR, allArgsR) + mkMethodCall(methR, tyargsR, allArgsR) else // The old method entry point - let methR: QuotationPickler.MethodData = + let methR: MethodData = { Parent = parentTyconR ArgTypes = methArgTypesR RetType = methRetTypeR @@ -893,14 +893,14 @@ and ConvObjectModelCallCore cenv env m (isPropGet, isPropSet, isNewObj, parentTy NumGenericArgs = numGenericArgs } // The witness-passing method entry point - let methWR: QuotationPickler.MethodData = + let methWR: MethodData = { Parent = parentTyconR ArgTypes = witnessArgTypesR @ methArgTypesR RetType = methRetTypeR Name = ExtraWitnessMethodName methName NumGenericArgs = numGenericArgs } - QP.mkMethodCallW(methR, methWR, List.length witnessArgTypesR, tyargsR, allArgsR) + mkMethodCallW(methR, methWR, List.length witnessArgTypesR, tyargsR, allArgsR) and ConvModuleValueApp cenv env m (vref:ValRef) tyargs witnessArgs (args: Expr list list) = EmitDebugInfoIfNecessary cenv env m (ConvModuleValueAppCore cenv env m vref tyargs witnessArgs args) @@ -917,9 +917,9 @@ and ConvModuleValueAppCore cenv env m (vref: ValRef) tyargs witnessArgsR (currie let allArgsR = witnessArgsR @ uncurriedArgsR let nWitnesses = witnessArgsR.Length if nWitnesses = 0 then - QP.mkModuleValueApp(tcrefR, nm, isProperty, tyargsR, allArgsR) + mkModuleValueApp(tcrefR, nm, isProperty, tyargsR, allArgsR) else - QP.mkModuleValueWApp(tcrefR, nm, isProperty, ExtraWitnessMethodName nm, nWitnesses, tyargsR, allArgsR) + mkModuleValueWApp(tcrefR, nm, isProperty, ExtraWitnessMethodName nm, nWitnesses, tyargsR, allArgsR) and ConvExprs cenv env args = List.map (ConvExpr cenv env) args @@ -938,9 +938,9 @@ and private ConvValRefCore holeOk cenv env m (vref: ValRef) tyargs = ConvExpr cenv env e elif env.vs.ContainsVal v then if not (List.isEmpty tyargs) then wfail(InternalError("ignoring generic application of local quoted variable", m)) - QP.mkVar(env.vs[v]) + mkVar(env.vs[v]) elif v.IsCtorThisVal && cenv.isReflectedDefinition = IsReflectedDefinition.Yes then - QP.mkThisVar(ConvType cenv env m v.Type) + mkThisVar(ConvType cenv env m v.Type) else let vTy = v.Type match v.TryDeclaringEntity with @@ -950,7 +950,7 @@ and private ConvValRefCore holeOk cenv env m (vref: ValRef) tyargs = let idx = cenv.exprSplices.Count let liftExpr = mkCallLiftValueWithName cenv.g m vTy v.LogicalName (exprForValRef m vref) cenv.exprSplices.Add((liftExpr, m)) - QP.mkHole(ConvType cenv env m vTy, idx) + mkHole(ConvType cenv env m vTy, idx) | Parent _ -> // First-class use or use of type function @@ -1008,7 +1008,7 @@ and ConvType cenv env m ty = | Some baseTy -> ConvType cenv env m baseTy | _ -> #endif - QP.mkILNamedTy(ConvTyconRef cenv tcref m, ConvTypes cenv env m tyargs) + mkILNamedTy(ConvTyconRef cenv tcref m, ConvTypes cenv env m tyargs) | TType_fun(a, b, _) -> QP.mkFunTy(ConvType cenv env m a, ConvType cenv env m b) @@ -1019,10 +1019,10 @@ and ConvType cenv env m ty = | TType_anon(anonInfo, tinst) -> let tref = anonInfo.ILTypeRef let tinstR = ConvTypes cenv env m tinst - QP.mkILNamedTy(ConvILTypeRefUnadjusted cenv m tref, tinstR) + mkILNamedTy(ConvILTypeRefUnadjusted cenv m tref, tinstR) | TType_var(tp, _) -> - QP.mkVarTy(ConvTyparRef cenv env m tp) + mkVarTy(ConvTyparRef cenv env m tp) | TType_forall(_spec, _ty) -> wfail(Error(FSComp.SR.crefNoInnerGenericsInQuotations(), m)) @@ -1040,24 +1040,24 @@ and ConvConst cenv env m c ty = let tyR = ConvType cenv env m ty match c with | Const.Bool i -> QP.mkBool (i, tyR) - | Const.SByte i -> QP.mkSByte (i, tyR) + | Const.SByte i -> mkSByte (i, tyR) | Const.Byte i -> QP.mkByte (i, tyR) - | Const.Int16 i -> QP.mkInt16 (i, tyR) + | Const.Int16 i -> mkInt16 (i, tyR) | Const.UInt16 i -> QP.mkUInt16 (i, tyR) | Const.Int32 i -> QP.mkInt32 (i, tyR) - | Const.UInt32 i -> QP.mkUInt32 (i, tyR) - | Const.Int64 i -> QP.mkInt64 (i, tyR) - | Const.UInt64 i -> QP.mkUInt64 (i, tyR) - | Const.Double i -> QP.mkDouble (i, tyR) - | Const.Single i -> QP.mkSingle (i, tyR) + | Const.UInt32 i -> mkUInt32 (i, tyR) + | Const.Int64 i -> mkInt64 (i, tyR) + | Const.UInt64 i -> mkUInt64 (i, tyR) + | Const.Double i -> mkDouble (i, tyR) + | Const.Single i -> mkSingle (i, tyR) | Const.String s -> QP.mkString (s, tyR) - | Const.Char c -> QP.mkChar (c, tyR) + | Const.Char c -> mkChar (c, tyR) | Const.Unit -> QP.mkUnit() | Const.Zero -> if isRefTy cenv.g ty then QP.mkNull tyR else - QP.mkDefaultValue tyR + mkDefaultValue tyR | _ -> wfail(Error(FSComp.SR.crefQuotationsCantContainThisConstant(), m)) @@ -1077,7 +1077,7 @@ and ConvDecisionTree cenv env tgs typR x = let e1R = ConvLValueExpr cenv env e1 let tcR, s = ConvUnionCaseRef cenv ucref m let tyargsR = ConvTypes cenv env m tyargs - QP.mkCond (QP.mkUnionCaseTagTest (tcR, s, tyargsR, e1R), ConvDecisionTree cenv env tgs typR dtree, acc) + QP.mkCond (mkUnionCaseTagTest (tcR, s, tyargsR, e1R), ConvDecisionTree cenv env tgs typR dtree, acc) | DecisionTreeTest.Const (Const.Bool true) -> let e1R = ConvExpr cenv env e1 @@ -1102,7 +1102,7 @@ and ConvDecisionTree cenv env tgs typR x = let tyR = ConvType cenv env m ty let eR = ConvExpr cenv env e // note: reverse the branches - a null test is a failure of an isinst test - QP.mkCond (QP.mkTypeTest (tyR, eR), acc, ConvDecisionTree cenv env tgs typR dtree) + QP.mkCond (mkTypeTest (tyR, eR), acc, ConvDecisionTree cenv env tgs typR dtree) | _ -> let ty = tyOfExpr cenv.g e1 let eq = mkCallEqualsOperator cenv.g m ty e1 (Expr.Const (Const.Zero, m, ty)) @@ -1113,7 +1113,7 @@ and ConvDecisionTree cenv env tgs typR x = | DecisionTreeTest.IsInst (_srcTy, tgtTy) -> let e1R = ConvExpr cenv env e1 - QP.mkCond (QP.mkTypeTest (ConvType cenv env m tgtTy, e1R), ConvDecisionTree cenv env tgs typR dtree, acc) + QP.mkCond (mkTypeTest (ConvType cenv env m tgtTy, e1R), ConvDecisionTree cenv env tgs typR dtree, acc) | DecisionTreeTest.ActivePatternCase _ -> wfail(InternalError( "DecisionTreeTest.ActivePatternCase test in quoted expression", m)) @@ -1183,7 +1183,7 @@ and ConvILTypeRef cenv (tr: ILTypeRef) = cenv.referencedTypeDefs.Add tr cenv.referencedTypeDefsTable[tr] <- idx idx - QP.Idx idx + Idx idx else let assemblyRef = @@ -1192,21 +1192,21 @@ and ConvILTypeRef cenv (tr: ILTypeRef) = | ILScopeRef.PrimaryAssembly -> cenv.g.ilg.primaryAssemblyScopeRef.QualifiedName | _ -> tr.Scope.QualifiedName - QP.Named(tr.BasicQualifiedName, assemblyRef) + Named(tr.BasicQualifiedName, assemblyRef) -and ConvVoidType cenv m = QP.mkILNamedTy(ConvTyconRef cenv cenv.g.system_Void_tcref m, []) +and ConvVoidType cenv m = mkILNamedTy(ConvTyconRef cenv cenv.g.system_Void_tcref m, []) and ConvILType cenv env m ty = match ty with | ILType.Boxed tspec | ILType.Value tspec -> - QP.mkILNamedTy(ConvILTypeRefUnadjusted cenv m tspec.TypeRef, List.map (ConvILType cenv env m) tspec.GenericArgs) + mkILNamedTy(ConvILTypeRefUnadjusted cenv m tspec.TypeRef, List.map (ConvILType cenv env m) tspec.GenericArgs) | ILType.Array (shape, ty) -> QP.mkArrayTy(shape.Rank, ConvILType cenv env m ty) | ILType.TypeVar idx -> - QP.mkVarTy(int idx) + mkVarTy(int idx) | ILType.Void -> ConvVoidType cenv m @@ -1291,11 +1291,11 @@ let ConvMethodBase cenv env (methName, v: Val) = if isNewObj then assert witnessArgTysR.IsEmpty - QP.MethodBaseData.Ctor + MethodBaseData.Ctor { Parent = parentTyconR ArgTypes = methArgTypesR } else - QP.MethodBaseData.Method + MethodBaseData.Method { Parent = parentTyconR ArgTypes = witnessArgTysR @ methArgTypesR RetType = methRetTypeR @@ -1313,7 +1313,7 @@ let ConvMethodBase cenv env (methName, v: Val) = let methRetTypeR = ConvReturnType cenv envinner m retTy let numGenericArgs = tps.Length - QP.MethodBaseData.Method + MethodBaseData.Method { Parent = parentTyconR ArgTypes = witnessArgTysR @ methArgTypesR RetType = methRetTypeR @@ -1327,7 +1327,7 @@ let ConvMethodBase cenv env (methName, v: Val) = let witnessArgTysR = ConvTypes cenv envinner m (GenWitnessTys cenv.g witnessInfos) let nWitnesses = witnessArgTysR.Length let witnessData = (if nWitnesses = 0 then None else Some (ExtraWitnessMethodName methName, nWitnesses)) - QP.MethodBaseData.ModuleDefn + MethodBaseData.ModuleDefn ({ Name = methName Module = parentTyconR IsProperty = IsCompiledAsStaticProperty cenv.g v }, witnessData) diff --git a/src/Compiler/Checking/SignatureHash.fs b/src/Compiler/Checking/SignatureHash.fs index a9bf8fce50e..8102f8dd364 100644 --- a/src/Compiler/Checking/SignatureHash.fs +++ b/src/Compiler/Checking/SignatureHash.fs @@ -76,7 +76,7 @@ module TyconDefinitionHash = let repr = tycon.TypeReprInfo - let tyconHash = HashTypes.hashTyconRef tcref + let tyconHash = hashTyconRef tcref let attribHash = hashAttributeList tcref.Attribs let typarsHash = hashTyparDecls g tycon.TyparsNoRange let topLevelDeclarationHash = tyconHash @@ attribHash @@ typarsHash @@ -212,7 +212,7 @@ let calculateHashOfAssemblyTopAttributes (attrs: TopAttribs) (platform: ILPlatfo | Some ARM64 -> 4 | Some X86 -> 5 - HashTypes.hashAttributeList attrs.assemblyAttrs - @@ HashTypes.hashAttributeList attrs.mainMethodAttrs - @@ HashTypes.hashAttributeList attrs.netModuleAttrs + hashAttributeList attrs.assemblyAttrs + @@ hashAttributeList attrs.mainMethodAttrs + @@ hashAttributeList attrs.netModuleAttrs @@ platformHash diff --git a/src/Compiler/Checking/infos.fs b/src/Compiler/Checking/infos.fs index 81c777c3685..47fc98edde1 100644 --- a/src/Compiler/Checking/infos.fs +++ b/src/Compiler/Checking/infos.fs @@ -471,7 +471,7 @@ type ILTypeInfo = let tref = mkRefForNestedILTypeDef scoref (enc, tdef) ILTypeInfo(g, ty, tref, tdef) else - failwith ("ILTypeInfo.FromType - no IL metadata for type" + System.Environment.StackTrace) + failwith ("ILTypeInfo.FromType - no IL metadata for type" + Environment.StackTrace) [] type ILMethParentTypeInfo = diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index 7c917fbfa9a..c571dc34a73 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -1748,7 +1748,7 @@ let AddDebugImportsToEnv (cenv: cenv) eenv (openDecls: OpenDeclaration list) = ILDebugImport.ImportType(mkILNonGenericBoxedTy modul.CompiledRepresentationForNamedType) for t in openDecl.Types do - let m = defaultArg openDecl.Range Range.range0 + let m = defaultArg openDecl.Range range0 ILDebugImport.ImportType(GenType cenv m TypeReprEnv.Empty t) |] @@ -2004,7 +2004,7 @@ and TypeDefsBuilder() = let tdefs = ConcurrentDictionary>(HashIdentity.Structural) - let mutable countDown = System.Int32.MaxValue + let mutable countDown = Int32.MaxValue let mutable countUp = -1 member b.Close(g: TcGlobals) = @@ -2502,7 +2502,7 @@ type CodeGenBuffer(m: range, mgbuf: AssemblyBuilder, methodName, alreadyUsedArgs Dictionary<_, _>(10) let rec lab2pc n lbl = - if n = System.Int32.MaxValue then + if n = Int32.MaxValue then error (InternalError("recursive label graph", m)) match codeLabelToCodeLabel.TryGetValue lbl with @@ -2520,7 +2520,7 @@ type CodeGenBuffer(m: range, mgbuf: AssemblyBuilder, methodName, alreadyUsedArgs for ty in pushes do stack <- ty :: stack nstack <- nstack + 1 - maxStack <- Operators.max maxStack nstack + maxStack <- max maxStack nstack member _.DoPops(n: Pops) = for i = 0 to n - 1 do @@ -2945,7 +2945,7 @@ and GenExprPreSteps (cenv: cenv) (cgbuf: CodeGenBuffer) eenv expr sequel = let others = [ for k in cenv.namedDebugPointsForInlinedCode.Keys do - if Range.equals m k.Range then + if equals m k.Range then yield k.Name ] |> String.concat "," @@ -3308,9 +3308,9 @@ and GenConstant cenv cgbuf eenv (c, m, ty) sequel = // see https://github.com/dotnet/fsharp/pull/3620 // and https://github.com/dotnet/fsharp/issue/8683 // and https://github.com/dotnet/roslyn/blob/98f12bb/src/Compilers/Core/Portable/CodeGen/ILBuilderEmit.cs#L679 - if i >= int64 System.Int32.MinValue && i <= int64 System.Int32.MaxValue then + if i >= int64 Int32.MinValue && i <= int64 Int32.MaxValue then CG.EmitInstrs cgbuf (pop 0) (Push [ ilTy ]) [ mkLdcInt32 (int32 i); AI_conv DT_I8 ] - elif i >= int64 System.UInt32.MinValue && i <= int64 System.UInt32.MaxValue then + elif i >= int64 UInt32.MinValue && i <= int64 UInt32.MaxValue then CG.EmitInstrs cgbuf (pop 0) (Push [ ilTy ]) [ mkLdcInt32 (int32 i); AI_conv DT_U8 ] else CG.EmitInstr cgbuf (pop 0) (Push [ ilTy ]) (iLdcInt64 i) @@ -5713,7 +5713,7 @@ and GenGenericParam cenv eenv (tp: Typar) = elif nm.Length >= 1 && nm[0] = 'T' - && (nm.Length = 1 || not (System.Char.IsLower nm[1])) + && (nm.Length = 1 || not (Char.IsLower nm[1])) then nm else @@ -7881,8 +7881,8 @@ and GenDecisionTreeSwitch (i, label.CodeLabel)) - let mn = List.foldBack (fst >> Operators.min) dests (fst (List.head dests)) - let mx = List.foldBack (fst >> Operators.max) dests (fst (List.head dests)) + let mn = List.foldBack (fst >> min) dests (fst (List.head dests)) + let mx = List.foldBack (fst >> max) dests (fst (List.head dests)) // Check if it's worth using a switch // REVIEW: this is using switches even for single integer matches! if mx - mn = (List.length dests - 1) then @@ -8578,7 +8578,7 @@ and GenBindingAfterDebugPoint cenv cgbuf eenv bind isStateVar startMarkOpt = optShadowLocal) -> let mut = vspec.IsMutable - let canTarget (targets, goal: System.AttributeTargets) = + let canTarget (targets, goal: AttributeTargets) = match targets with | None -> true | Some tgts -> 0 <> int (tgts &&& goal) @@ -8617,7 +8617,7 @@ and GenBindingAfterDebugPoint cenv cgbuf eenv bind isStateVar startMarkOpt = let ilAttribs = if not hasLiteralAttr then vspec.Attribs - |> List.filter (fun (Attrib(_, _, _, _, _, targets, _)) -> canTarget (targets, System.AttributeTargets.Field)) + |> List.filter (fun (Attrib(_, _, _, _, _, targets, _)) -> canTarget (targets, AttributeTargets.Field)) |> GenAttrs cenv eenv // backing field only gets attributes that target fields else GenAttrs cenv eenv vspec.Attribs // literals have no property, so preserve all the attributes on the field itself @@ -8628,7 +8628,7 @@ and GenBindingAfterDebugPoint cenv cgbuf eenv bind isStateVar startMarkOpt = if isDecimalConstant then match vref.LiteralValue with | Some(Const.Decimal d) -> - match System.Decimal.GetBits d with + match Decimal.GetBits d with | [| lo; med; hi; signExp |] -> let scale = (min (((signExp &&& 0xFF0000) >>> 16) &&& 0xFF) 28) |> byte let sign = if (signExp &&& 0x80000000) <> 0 then 1uy else 0uy @@ -8701,7 +8701,7 @@ and GenBindingAfterDebugPoint cenv cgbuf eenv bind isStateVar startMarkOpt = else let ilAttribs = vspec.Attribs - |> List.filter (fun (Attrib(_, _, _, _, _, targets, _)) -> canTarget (targets, System.AttributeTargets.Property)) + |> List.filter (fun (Attrib(_, _, _, _, _, targets, _)) -> canTarget (targets, AttributeTargets.Property)) |> GenAttrs cenv eenv // property only gets attributes that target properties |> List.append (GenAdditionalAttributesForTy g vspec.Type) diff --git a/src/Compiler/CodeGen/IlxGenSupport.fs b/src/Compiler/CodeGen/IlxGenSupport.fs index 14a594912ae..a96a860652f 100644 --- a/src/Compiler/CodeGen/IlxGenSupport.fs +++ b/src/Compiler/CodeGen/IlxGenSupport.fs @@ -351,7 +351,7 @@ let GetNotNullWhenTrueAttribute (g: TcGlobals) (propNames: string array) = [] ) -let GetNullableAttribute (g: TcGlobals) (nullnessInfos: TypedTree.NullnessInfo list) = +let GetNullableAttribute (g: TcGlobals) (nullnessInfos: NullnessInfo list) = let tref = g.attrib_NullableAttribute.TypeRef g.TryEmbedILType(tref, (fun () -> mkLocalPrivateAttributeWithByteAndByteArrayConstructors (g, tref.Name, "NullableFlags"))) diff --git a/src/Compiler/Driver/CompilerConfig.fs b/src/Compiler/Driver/CompilerConfig.fs index 0db023fc327..ddde2887a4a 100644 --- a/src/Compiler/Driver/CompilerConfig.fs +++ b/src/Compiler/Driver/CompilerConfig.fs @@ -346,7 +346,7 @@ type ImportedAssembly = IsProviderGenerated: bool mutable TypeProviders: Tainted list #endif - FSharpOptimizationData: Microsoft.FSharp.Control.Lazy + FSharpOptimizationData: Microsoft.FSharp.Control.Lazy } type AvailableImportedAssembly = @@ -564,7 +564,7 @@ type TcConfigBuilder = mutable doTLR: bool (* run TLR pass? *) mutable doFinalSimplify: bool (* do final simplification pass *) mutable optsOn: bool (* optimizations are turned on *) - mutable optSettings: Optimizer.OptimizationSettings + mutable optSettings: OptimizationSettings mutable emitTailcalls: bool mutable deterministic: bool mutable parallelParsing: bool diff --git a/src/Compiler/Driver/CompilerDiagnostics.fs b/src/Compiler/Driver/CompilerDiagnostics.fs index c5a04657a72..e46cb1ad66b 100644 --- a/src/Compiler/Driver/CompilerDiagnostics.fs +++ b/src/Compiler/Driver/CompilerDiagnostics.fs @@ -201,7 +201,7 @@ type Exception with | NoConstructorsAvailableForType(_, _, m) -> Some m // Strip TargetInvocationException wrappers - | :? System.Reflection.TargetInvocationException as e when isNotNull e.InnerException -> (!!e.InnerException).DiagnosticRange + | :? TargetInvocationException as e when isNotNull e.InnerException -> (!!e.InnerException).DiagnosticRange #if !NO_TYPEPROVIDERS | :? TypeProviderError as e -> e.Range |> Some #endif @@ -2207,7 +2207,7 @@ let CollectFormattedDiagnostics (tcConfig: TcConfig, severity: FSharpDiagnosticS let content = m.FileName |> FileSystem.GetFullFilePathInDirectoryShim tcConfig.implicitIncludeDir - |> System.IO.File.ReadAllLines + |> File.ReadAllLines if m.StartLine = m.EndLine then $"\n {m.StartLine} | {content[m.StartLine - 1]}\n" diff --git a/src/Compiler/Driver/CompilerOptions.fs b/src/Compiler/Driver/CompilerOptions.fs index 4dd36dec6bd..6440607f4b5 100644 --- a/src/Compiler/Driver/CompilerOptions.fs +++ b/src/Compiler/Driver/CompilerOptions.fs @@ -1220,7 +1220,7 @@ let codePageFlag (tcConfigB: TcConfigBuilder) = tagInt, OptionInt(fun n -> try - System.Text.Encoding.GetEncoding n |> ignore + Encoding.GetEncoding n |> ignore with :? ArgumentException as err -> error (Error(FSComp.SR.optsProblemWithCodepage (n, err.Message), rangeCmdArgs)) diff --git a/src/Compiler/Driver/GraphChecking/GraphProcessing.fs b/src/Compiler/Driver/GraphChecking/GraphProcessing.fs index 33dd1c42c46..1854368285e 100644 --- a/src/Compiler/Driver/GraphChecking/GraphProcessing.fs +++ b/src/Compiler/Driver/GraphChecking/GraphProcessing.fs @@ -35,7 +35,7 @@ type ProcessedNode<'Item, 'Result> = Result: 'Result } -type GraphProcessingException(msg, ex: System.Exception) = +type GraphProcessingException(msg, ex: Exception) = inherit exn(msg, ex) let processGraph<'Item, 'Result when 'Item: equality and 'Item: comparison> @@ -96,7 +96,7 @@ let processGraph<'Item, 'Result when 'Item: equality and 'Item: comparison> /// Create a setter and getter for an exception raised in one of the work items. /// Only the first exception encountered is stored - this can cause non-deterministic errors if more than one item fails. let raiseExn, getExn = - let mutable exn: ('Item * System.Exception) option = None + let mutable exn: ('Item * Exception) option = None let lockObj = obj () // Only set the exception if it hasn't been set already let setExn newExn = diff --git a/src/Compiler/Driver/ParseAndCheckInputs.fs b/src/Compiler/Driver/ParseAndCheckInputs.fs index c6de5e776a1..2256a3e8ad6 100644 --- a/src/Compiler/Driver/ParseAndCheckInputs.fs +++ b/src/Compiler/Driver/ParseAndCheckInputs.fs @@ -469,10 +469,10 @@ let ParseInput // Call the appropriate parser - for signature files or implementation files if FSharpImplFileSuffixes |> List.exists (FileSystemUtils.checkSuffix fileName) then - let impl = Parser.implementationFile lexer lexbuf + let impl = implementationFile lexer lexbuf PostParseModuleImpls(defaultNamespace, fileName, isLastCompiland, impl, lexbuf, diagnosticOptions, Set identStore) elif FSharpSigFileSuffixes |> List.exists (FileSystemUtils.checkSuffix fileName) then - let intfs = Parser.signatureFile lexer lexbuf + let intfs = signatureFile lexer lexbuf PostParseModuleSpecs(defaultNamespace, fileName, isLastCompiland, intfs, lexbuf, diagnosticOptions, Set identStore) else if lexbuf.SupportsFeature LanguageFeature.MLCompatRevisions then error (Error(FSComp.SR.buildInvalidSourceFileExtensionUpdated fileName, rangeStartup)) @@ -485,7 +485,7 @@ let ParseInput delayLogger.CommitDelayedDiagnostics filteringDiagnosticsLogger -type Tokenizer = unit -> Parser.token +type Tokenizer = unit -> token // Show all tokens in the stream, for testing purposes let ShowAllTokensAndExit (tokenizer: Tokenizer, lexbuf: LexBuffer, exiter: Exiter) = @@ -508,7 +508,7 @@ let ShowAllTokensAndExit (tokenizer: Tokenizer, lexbuf: LexBuffer, exiter: | _ -> indent match t with - | Parser.EOF _ -> exiter.Exit 0 + | EOF _ -> exiter.Exit 0 | _ -> () if lexbuf.IsPastEndOfStream then @@ -517,7 +517,7 @@ let ShowAllTokensAndExit (tokenizer: Tokenizer, lexbuf: LexBuffer, exiter: // Test one of the parser entry points, just for testing purposes let TestInteractionParserAndExit (tokenizer: Tokenizer, lexbuf: LexBuffer, exiter: Exiter) = while true do - match (Parser.interaction (fun _ -> tokenizer ()) lexbuf) with + match (interaction (fun _ -> tokenizer ()) lexbuf) with | ParsedScriptInteraction.Definitions(l, m) -> printfn "Parsed OK, got %d defs @ %a" l.Length outputRange m exiter.Exit 0 diff --git a/src/Compiler/Driver/ParseAndCheckInputs.fsi b/src/Compiler/Driver/ParseAndCheckInputs.fsi index 36f3493724c..ade044d2c92 100644 --- a/src/Compiler/Driver/ParseAndCheckInputs.fsi +++ b/src/Compiler/Driver/ParseAndCheckInputs.fsi @@ -180,7 +180,7 @@ val CheckOneInput: tcImports: TcImports * tcGlobals: TcGlobals * prefixPathOpt: LongIdent option * - tcSink: NameResolution.TcResultsSink * + tcSink: TcResultsSink * tcState: TcState * input: ParsedInput -> Cancellable<(TcEnv * TopAttribs * CheckedImplFile option * ModuleOrNamespaceType) * TcState> @@ -248,7 +248,7 @@ val CheckOneInputAndFinish: tcImports: TcImports * tcGlobals: TcGlobals * prefixPathOpt: LongIdent option * - tcSink: NameResolution.TcResultsSink * + tcSink: TcResultsSink * tcState: TcState * input: ParsedInput -> Cancellable<(TcEnv * TopAttribs * CheckedImplFile list * ModuleOrNamespaceType list) * TcState> diff --git a/src/Compiler/Facilities/DiagnosticsLogger.fs b/src/Compiler/Facilities/DiagnosticsLogger.fs index b3d08d6d1a3..4152b951a0a 100644 --- a/src/Compiler/Facilities/DiagnosticsLogger.fs +++ b/src/Compiler/Facilities/DiagnosticsLogger.fs @@ -483,8 +483,8 @@ module DiagnosticsLoggerExtensions = // Throws StopProcessing and exceptions raised by the DiagnosticSink(exn) handler. match exn with // Don't send ThreadAbortException down the error channel - | :? System.Threading.ThreadAbortException - | WrappedError(:? System.Threading.ThreadAbortException, _) -> () + | :? ThreadAbortException + | WrappedError(:? ThreadAbortException, _) -> () | ReportedError _ | WrappedError(ReportedError _, _) -> () | StopProcessing diff --git a/src/Compiler/Facilities/Hashing.fs b/src/Compiler/Facilities/Hashing.fs index 020b50e2663..d67f879ef14 100644 --- a/src/Compiler/Facilities/Hashing.fs +++ b/src/Compiler/Facilities/Hashing.fs @@ -21,7 +21,7 @@ module internal Md5StringHasher = Array.append sbytes bytes |> computeHash - |> System.BitConverter.ToString + |> BitConverter.ToString |> (fun x -> x.Replace("-", "")) let addString (s: string) (s2: string) = @@ -39,7 +39,7 @@ module internal Md5StringHasher = let addBool (b: bool) (s: string) = b |> BitConverter.GetBytes |> addBytes <| s - let addDateTime (dt: System.DateTime) (s: string) = dt.Ticks.ToString() |> addString <| s + let addDateTime (dt: DateTime) (s: string) = dt.Ticks.ToString() |> addString <| s module internal Md5Hasher = @@ -77,10 +77,10 @@ module internal Md5Hasher = let addBool (b: bool) (s: byte array) = b |> BitConverter.GetBytes |> addBytes <| s - let addDateTime (dt: System.DateTime) (s: byte array) = + let addDateTime (dt: DateTime) (s: byte array) = dt.Ticks |> BitConverter.GetBytes |> addBytes <| s - let addDateTimes (dts: System.DateTime seq) (s: byte array) = s |> addSeq dts addDateTime + let addDateTimes (dts: DateTime seq) (s: byte array) = s |> addSeq dts addDateTime let addInt (i: int) (s: byte array) = i |> BitConverter.GetBytes |> addBytes <| s @@ -89,4 +89,4 @@ module internal Md5Hasher = let addBooleans (items: bool seq) (s: byte array) = addSeq items addBool s - let toString (bytes: byte array) = bytes |> System.BitConverter.ToString + let toString (bytes: byte array) = bytes |> BitConverter.ToString diff --git a/src/Compiler/Interactive/ControlledExecution.fs b/src/Compiler/Interactive/ControlledExecution.fs index 2d18a8819b2..ba03026bead 100644 --- a/src/Compiler/Interactive/ControlledExecution.fs +++ b/src/Compiler/Interactive/ControlledExecution.fs @@ -27,7 +27,7 @@ type internal ControlledExecution(isInteractive: bool) = static let ceType: Type option = Option.ofObj (Type.GetType("System.Runtime.ControlledExecution, System.Private.CoreLib", false)) - static let threadType: Type option = typeof |> Option.ofObj + static let threadType: Type option = typeof |> Option.ofObj static let ceRun: MethodInfo option = match ceType with @@ -37,7 +37,7 @@ type internal ControlledExecution(isInteractive: bool) = "Run", BindingFlags.Static ||| BindingFlags.Public, defaultof, - [| typeof; typeof |], + [| typeof; typeof |], [||] ) |> Option.ofObj diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index fc1a55ca445..296a3dbfc1e 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -103,7 +103,7 @@ module internal Utilities = let getAnyToLayoutCall (ty: Type) = if ty.IsPointer then let pointerToNativeInt (o: obj) : nativeint = - System.Reflection.Pointer.Unbox o + Pointer.Unbox o |> NativeInterop.NativePtr.ofVoidPtr> |> NativeInterop.NativePtr.toNativeInt @@ -306,7 +306,7 @@ type ILMultiInMemoryAssemblyEmitEnv let internalTypes = HashSet(HashIdentity.Structural) let internalMethods = HashSet(HashIdentity.Structural) let internalFields = HashSet(HashIdentity.Structural) - let dynamicCcuScopeRef = ILScopeRef.Assembly(IL.mkSimpleAssemblyRef dynamicCcuName) + let dynamicCcuScopeRef = ILScopeRef.Assembly(mkSimpleAssemblyRef dynamicCcuName) /// Convert an ILAssemblyRef to a dynamic System.Type given the dynamic emit context let convAssemblyRef (aref: ILAssemblyRef) = @@ -322,7 +322,7 @@ type ILMultiInMemoryAssemblyEmitEnv | None -> () | Some version -> asmName.Version <- Version(int32 version.Major, int32 version.Minor, int32 version.Build, int32 version.Revision) - asmName.CultureInfo <- System.Globalization.CultureInfo.InvariantCulture + asmName.CultureInfo <- CultureInfo.InvariantCulture asmName /// Convert an ILAssemblyRef to a dynamic System.Type given the dynamic emit context @@ -485,7 +485,7 @@ type ILMultiInMemoryAssemblyEmitEnv fref.DeclaringTypeRef.Scope.IsLocalRef && internalFields.Contains(fref) type ILAssemblyEmitEnv = - | SingleRefEmitAssembly of ILDynamicAssemblyWriter.cenv * ILDynamicAssemblyEmitEnv + | SingleRefEmitAssembly of cenv * ILDynamicAssemblyEmitEnv | MultipleInMemoryAssemblies of ILMultiInMemoryAssemblyEmitEnv type internal FsiValuePrinterMode = @@ -881,7 +881,7 @@ type internal FsiConsoleOutput(tcConfigB, outWriter: TextWriter, errorWriter: Te out.uprintfnn fmt /// clear screen - member _.Clear() = System.Console.Clear() + member _.Clear() = Console.Clear() member _.Out = outWriter @@ -1924,7 +1924,7 @@ type internal FsiDynamicCompiler null, null, [||], - Globalization.CultureInfo.InvariantCulture + CultureInfo.InvariantCulture ) ) @@ -3044,7 +3044,7 @@ type internal FsiDynamicCompiler tryFindSysILTypeRef = tcGlobals.TryFindSysILTypeRef } - let emEnv = ILDynamicAssemblyWriter.emEnv0 + let emEnv = emEnv0 SingleRefEmitAssembly(cenv, emEnv) let ccuName = dynamicCcuName (tcConfigB.fsiMultiAssemblyEmit) @@ -4636,7 +4636,7 @@ type FsiEvaluationSession warning (e) let restoreEncoding = - if tcConfigB.utf8output && Console.OutputEncoding <> Text.Encoding.UTF8 then + if tcConfigB.utf8output && Console.OutputEncoding <> Encoding.UTF8 then let previousEncoding = Console.OutputEncoding Console.OutputEncoding <- Encoding.UTF8 diff --git a/src/Compiler/Interactive/fsihelp.fs b/src/Compiler/Interactive/fsihelp.fs index f21da3ab441..e4fb4e26887 100644 --- a/src/Compiler/Interactive/fsihelp.fs +++ b/src/Compiler/Interactive/fsihelp.fs @@ -96,7 +96,7 @@ module Parser = with _ -> None - let getTexts (node: Xml.XmlNode) = + let getTexts (node: XmlNode) = seq { for child in node.ChildNodes do if child.Name = "#text" then diff --git a/src/Compiler/Optimize/DetupleArgs.fs b/src/Compiler/Optimize/DetupleArgs.fs index 2feb6adaeb6..0531f72ad1c 100644 --- a/src/Compiler/Optimize/DetupleArgs.fs +++ b/src/Compiler/Optimize/DetupleArgs.fs @@ -687,7 +687,7 @@ let eligibleVal g m (v: Val) = && not // .IsCompiledAsTopLevel && v.IsCompiledAsTopLevel -let determineTransforms g (z: GlobalUsageAnalysis.Results) = +let determineTransforms g (z: Results) = let selectTransform (f: Val) sites = if not (eligibleVal g f.Range f) then None diff --git a/src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs b/src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs index df9fc6b6cd0..885917fee37 100644 --- a/src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs +++ b/src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs @@ -191,7 +191,7 @@ module Pass1_DetermineTLRAndArities = let tps, vss, _b, _rty = stripTopLambda (e, f.Type) let nFormals = vss.Length let nMaxApplied = GetMaxNumArgsAtUses xinfo f - let arity = Operators.min nFormals nMaxApplied + let arity = min nFormals nMaxApplied if atTopLevel then Some (f, arity) elif g.realsig then diff --git a/src/Compiler/Optimize/Optimizer.fs b/src/Compiler/Optimize/Optimizer.fs index f9fa5b2784b..cf242d7b197 100644 --- a/src/Compiler/Optimize/Optimizer.fs +++ b/src/Compiler/Optimize/Optimizer.fs @@ -833,7 +833,7 @@ let inline IntegerBinaryOp g f8 f16 f32 f64 fu8 fu16 fu32 fu64 a b = | _ -> None | _ -> None -module Unchecked = Microsoft.FSharp.Core.Operators +module Unchecked = Operators /// Evaluate primitives based on interpretation of IL instructions. /// @@ -957,98 +957,98 @@ let mkAssemblyCodeValueInfo g instrs argvals tys = | [ AI_conv DT_U1 ], [a], [ty] when typeEquiv g ty g.byte_ty -> match stripValue a with - | ConstValue(Const.SByte a, _) -> mkUInt8Val g (Unchecked.byte a) - | ConstValue(Const.Int16 a, _) -> mkUInt8Val g (Unchecked.byte a) - | ConstValue(Const.Int32 a, _) -> mkUInt8Val g (Unchecked.byte a) - | ConstValue(Const.Int64 a, _) -> mkUInt8Val g (Unchecked.byte a) - | ConstValue(Const.Byte a, _) -> mkUInt8Val g (Unchecked.byte a) - | ConstValue(Const.UInt16 a, _) -> mkUInt8Val g (Unchecked.byte a) - | ConstValue(Const.UInt32 a, _) -> mkUInt8Val g (Unchecked.byte a) - | ConstValue(Const.UInt64 a, _) -> mkUInt8Val g (Unchecked.byte a) + | ConstValue(Const.SByte a, _) -> mkUInt8Val g (byte a) + | ConstValue(Const.Int16 a, _) -> mkUInt8Val g (byte a) + | ConstValue(Const.Int32 a, _) -> mkUInt8Val g (byte a) + | ConstValue(Const.Int64 a, _) -> mkUInt8Val g (byte a) + | ConstValue(Const.Byte a, _) -> mkUInt8Val g (byte a) + | ConstValue(Const.UInt16 a, _) -> mkUInt8Val g (byte a) + | ConstValue(Const.UInt32 a, _) -> mkUInt8Val g (byte a) + | ConstValue(Const.UInt64 a, _) -> mkUInt8Val g (byte a) | _ -> UnknownValue | [ AI_conv DT_U2 ], [a], [ty] when typeEquiv g ty g.uint16_ty -> match stripValue a with - | ConstValue(Const.SByte a, _) -> mkUInt16Val g (Unchecked.uint16 a) - | ConstValue(Const.Int16 a, _) -> mkUInt16Val g (Unchecked.uint16 a) - | ConstValue(Const.Int32 a, _) -> mkUInt16Val g (Unchecked.uint16 a) - | ConstValue(Const.Int64 a, _) -> mkUInt16Val g (Unchecked.uint16 a) - | ConstValue(Const.Byte a, _) -> mkUInt16Val g (Unchecked.uint16 a) - | ConstValue(Const.UInt16 a, _) -> mkUInt16Val g (Unchecked.uint16 a) - | ConstValue(Const.UInt32 a, _) -> mkUInt16Val g (Unchecked.uint16 a) - | ConstValue(Const.UInt64 a, _) -> mkUInt16Val g (Unchecked.uint16 a) + | ConstValue(Const.SByte a, _) -> mkUInt16Val g (uint16 a) + | ConstValue(Const.Int16 a, _) -> mkUInt16Val g (uint16 a) + | ConstValue(Const.Int32 a, _) -> mkUInt16Val g (uint16 a) + | ConstValue(Const.Int64 a, _) -> mkUInt16Val g (uint16 a) + | ConstValue(Const.Byte a, _) -> mkUInt16Val g (uint16 a) + | ConstValue(Const.UInt16 a, _) -> mkUInt16Val g (uint16 a) + | ConstValue(Const.UInt32 a, _) -> mkUInt16Val g (uint16 a) + | ConstValue(Const.UInt64 a, _) -> mkUInt16Val g (uint16 a) | _ -> UnknownValue | [ AI_conv DT_U4 ], [a], [ty] when typeEquiv g ty g.uint32_ty -> match stripValue a with - | ConstValue(Const.SByte a, _) -> mkUInt32Val g (Unchecked.uint32 a) - | ConstValue(Const.Int16 a, _) -> mkUInt32Val g (Unchecked.uint32 a) - | ConstValue(Const.Int32 a, _) -> mkUInt32Val g (Unchecked.uint32 a) - | ConstValue(Const.Int64 a, _) -> mkUInt32Val g (Unchecked.uint32 a) - | ConstValue(Const.Byte a, _) -> mkUInt32Val g (Unchecked.uint32 a) - | ConstValue(Const.UInt16 a, _) -> mkUInt32Val g (Unchecked.uint32 a) - | ConstValue(Const.UInt32 a, _) -> mkUInt32Val g (Unchecked.uint32 a) - | ConstValue(Const.UInt64 a, _) -> mkUInt32Val g (Unchecked.uint32 a) + | ConstValue(Const.SByte a, _) -> mkUInt32Val g (uint32 a) + | ConstValue(Const.Int16 a, _) -> mkUInt32Val g (uint32 a) + | ConstValue(Const.Int32 a, _) -> mkUInt32Val g (uint32 a) + | ConstValue(Const.Int64 a, _) -> mkUInt32Val g (uint32 a) + | ConstValue(Const.Byte a, _) -> mkUInt32Val g (uint32 a) + | ConstValue(Const.UInt16 a, _) -> mkUInt32Val g (uint32 a) + | ConstValue(Const.UInt32 a, _) -> mkUInt32Val g (uint32 a) + | ConstValue(Const.UInt64 a, _) -> mkUInt32Val g (uint32 a) | _ -> UnknownValue | [ AI_conv DT_U8 ], [a], [ty] when typeEquiv g ty g.uint64_ty -> match stripValue a with - | ConstValue(Const.SByte a, _) -> mkUInt64Val g (Unchecked.uint64 a) - | ConstValue(Const.Int16 a, _) -> mkUInt64Val g (Unchecked.uint64 a) - | ConstValue(Const.Int32 a, _) -> mkUInt64Val g (Unchecked.uint64 a) - | ConstValue(Const.Int64 a, _) -> mkUInt64Val g (Unchecked.uint64 a) - | ConstValue(Const.Byte a, _) -> mkUInt64Val g (Unchecked.uint64 a) - | ConstValue(Const.UInt16 a, _) -> mkUInt64Val g (Unchecked.uint64 a) - | ConstValue(Const.UInt32 a, _) -> mkUInt64Val g (Unchecked.uint64 a) - | ConstValue(Const.UInt64 a, _) -> mkUInt64Val g (Unchecked.uint64 a) + | ConstValue(Const.SByte a, _) -> mkUInt64Val g (uint64 a) + | ConstValue(Const.Int16 a, _) -> mkUInt64Val g (uint64 a) + | ConstValue(Const.Int32 a, _) -> mkUInt64Val g (uint64 a) + | ConstValue(Const.Int64 a, _) -> mkUInt64Val g (uint64 a) + | ConstValue(Const.Byte a, _) -> mkUInt64Val g (uint64 a) + | ConstValue(Const.UInt16 a, _) -> mkUInt64Val g (uint64 a) + | ConstValue(Const.UInt32 a, _) -> mkUInt64Val g (uint64 a) + | ConstValue(Const.UInt64 a, _) -> mkUInt64Val g (uint64 a) | _ -> UnknownValue | [ AI_conv DT_I1 ], [a], [ty] when typeEquiv g ty g.sbyte_ty -> match stripValue a with - | ConstValue(Const.SByte a, _) -> mkInt8Val g (Unchecked.sbyte a) - | ConstValue(Const.Int16 a, _) -> mkInt8Val g (Unchecked.sbyte a) - | ConstValue(Const.Int32 a, _) -> mkInt8Val g (Unchecked.sbyte a) - | ConstValue(Const.Int64 a, _) -> mkInt8Val g (Unchecked.sbyte a) - | ConstValue(Const.Byte a, _) -> mkInt8Val g (Unchecked.sbyte a) - | ConstValue(Const.UInt16 a, _) -> mkInt8Val g (Unchecked.sbyte a) - | ConstValue(Const.UInt32 a, _) -> mkInt8Val g (Unchecked.sbyte a) - | ConstValue(Const.UInt64 a, _) -> mkInt8Val g (Unchecked.sbyte a) + | ConstValue(Const.SByte a, _) -> mkInt8Val g (sbyte a) + | ConstValue(Const.Int16 a, _) -> mkInt8Val g (sbyte a) + | ConstValue(Const.Int32 a, _) -> mkInt8Val g (sbyte a) + | ConstValue(Const.Int64 a, _) -> mkInt8Val g (sbyte a) + | ConstValue(Const.Byte a, _) -> mkInt8Val g (sbyte a) + | ConstValue(Const.UInt16 a, _) -> mkInt8Val g (sbyte a) + | ConstValue(Const.UInt32 a, _) -> mkInt8Val g (sbyte a) + | ConstValue(Const.UInt64 a, _) -> mkInt8Val g (sbyte a) | _ -> UnknownValue | [ AI_conv DT_I2 ], [a], [ty] when typeEquiv g ty g.int16_ty -> match stripValue a with - | ConstValue(Const.Int32 a, _) -> mkInt16Val g (Unchecked.int16 a) - | ConstValue(Const.Int16 a, _) -> mkInt16Val g (Unchecked.int16 a) - | ConstValue(Const.SByte a, _) -> mkInt16Val g (Unchecked.int16 a) - | ConstValue(Const.Int64 a, _) -> mkInt16Val g (Unchecked.int16 a) - | ConstValue(Const.UInt32 a, _) -> mkInt16Val g (Unchecked.int16 a) - | ConstValue(Const.UInt16 a, _) -> mkInt16Val g (Unchecked.int16 a) - | ConstValue(Const.Byte a, _) -> mkInt16Val g (Unchecked.int16 a) - | ConstValue(Const.UInt64 a, _) -> mkInt16Val g (Unchecked.int16 a) + | ConstValue(Const.Int32 a, _) -> mkInt16Val g (int16 a) + | ConstValue(Const.Int16 a, _) -> mkInt16Val g (int16 a) + | ConstValue(Const.SByte a, _) -> mkInt16Val g (int16 a) + | ConstValue(Const.Int64 a, _) -> mkInt16Val g (int16 a) + | ConstValue(Const.UInt32 a, _) -> mkInt16Val g (int16 a) + | ConstValue(Const.UInt16 a, _) -> mkInt16Val g (int16 a) + | ConstValue(Const.Byte a, _) -> mkInt16Val g (int16 a) + | ConstValue(Const.UInt64 a, _) -> mkInt16Val g (int16 a) | _ -> UnknownValue | [ AI_conv DT_I4 ], [a], [ty] when typeEquiv g ty g.int32_ty -> match stripValue a with - | ConstValue(Const.Int32 a, _) -> mkInt32Val g (Unchecked.int32 a) - | ConstValue(Const.Int16 a, _) -> mkInt32Val g (Unchecked.int32 a) - | ConstValue(Const.SByte a, _) -> mkInt32Val g (Unchecked.int32 a) - | ConstValue(Const.Int64 a, _) -> mkInt32Val g (Unchecked.int32 a) - | ConstValue(Const.UInt32 a, _) -> mkInt32Val g (Unchecked.int32 a) - | ConstValue(Const.UInt16 a, _) -> mkInt32Val g (Unchecked.int32 a) - | ConstValue(Const.Byte a, _) -> mkInt32Val g (Unchecked.int32 a) - | ConstValue(Const.UInt64 a, _) -> mkInt32Val g (Unchecked.int32 a) + | ConstValue(Const.Int32 a, _) -> mkInt32Val g (int32 a) + | ConstValue(Const.Int16 a, _) -> mkInt32Val g (int32 a) + | ConstValue(Const.SByte a, _) -> mkInt32Val g (int32 a) + | ConstValue(Const.Int64 a, _) -> mkInt32Val g (int32 a) + | ConstValue(Const.UInt32 a, _) -> mkInt32Val g (int32 a) + | ConstValue(Const.UInt16 a, _) -> mkInt32Val g (int32 a) + | ConstValue(Const.Byte a, _) -> mkInt32Val g (int32 a) + | ConstValue(Const.UInt64 a, _) -> mkInt32Val g (int32 a) | _ -> UnknownValue | [ AI_conv DT_I8 ], [a], [ty] when typeEquiv g ty g.int64_ty -> match stripValue a with - | ConstValue(Const.Int32 a, _) -> mkInt64Val g (Unchecked.int64 a) - | ConstValue(Const.Int16 a, _) -> mkInt64Val g (Unchecked.int64 a) - | ConstValue(Const.SByte a, _) -> mkInt64Val g (Unchecked.int64 a) - | ConstValue(Const.Int64 a, _) -> mkInt64Val g (Unchecked.int64 a) - | ConstValue(Const.UInt32 a, _) -> mkInt64Val g (Unchecked.int64 a) - | ConstValue(Const.UInt16 a, _) -> mkInt64Val g (Unchecked.int64 a) - | ConstValue(Const.Byte a, _) -> mkInt64Val g (Unchecked.int64 a) - | ConstValue(Const.UInt64 a, _) -> mkInt64Val g (Unchecked.int64 a) + | ConstValue(Const.Int32 a, _) -> mkInt64Val g (int64 a) + | ConstValue(Const.Int16 a, _) -> mkInt64Val g (int64 a) + | ConstValue(Const.SByte a, _) -> mkInt64Val g (int64 a) + | ConstValue(Const.Int64 a, _) -> mkInt64Val g (int64 a) + | ConstValue(Const.UInt32 a, _) -> mkInt64Val g (int64 a) + | ConstValue(Const.UInt16 a, _) -> mkInt64Val g (int64 a) + | ConstValue(Const.Byte a, _) -> mkInt64Val g (int64 a) + | ConstValue(Const.UInt64 a, _) -> mkInt64Val g (int64 a) | _ -> UnknownValue | [ AI_clt_un ], [a;b], [ty] when typeEquiv g ty g.bool_ty -> @@ -1262,37 +1262,37 @@ let mkAssemblyCodeValueInfo g instrs argvals tys = else UnknownValue | ConstValue(Const.SByte a, _) -> if typeEquiv g ty g.sbyte_ty then v - elif typeEquiv g ty g.int16_ty then mkInt16Val g (Unchecked.int16 a) - elif typeEquiv g ty g.int32_ty then mkInt32Val g (Unchecked.int32 a) + elif typeEquiv g ty g.int16_ty then mkInt16Val g (int16 a) + elif typeEquiv g ty g.int32_ty then mkInt32Val g (int32 a) else UnknownValue | ConstValue(Const.Byte a, _) -> if typeEquiv g ty g.byte_ty then v - elif typeEquiv g ty g.uint16_ty then mkUInt16Val g (Unchecked.uint16 a) - elif typeEquiv g ty g.uint32_ty then mkUInt32Val g (Unchecked.uint32 a) + elif typeEquiv g ty g.uint16_ty then mkUInt16Val g (uint16 a) + elif typeEquiv g ty g.uint32_ty then mkUInt32Val g (uint32 a) else UnknownValue | ConstValue(Const.Int16 a, _) -> if typeEquiv g ty g.int16_ty then v - elif typeEquiv g ty g.int32_ty then mkInt32Val g (Unchecked.int32 a) + elif typeEquiv g ty g.int32_ty then mkInt32Val g (int32 a) else UnknownValue | ConstValue(Const.UInt16 a, _) -> if typeEquiv g ty g.uint16_ty then v - elif typeEquiv g ty g.uint32_ty then mkUInt32Val g (Unchecked.uint32 a) + elif typeEquiv g ty g.uint32_ty then mkUInt32Val g (uint32 a) else UnknownValue | ConstValue(Const.Int32 a, _) -> if typeEquiv g ty g.int32_ty then v - elif typeEquiv g ty g.uint32_ty then mkUInt32Val g (Unchecked.uint32 a) + elif typeEquiv g ty g.uint32_ty then mkUInt32Val g (uint32 a) else UnknownValue | ConstValue(Const.UInt32 a, _) -> if typeEquiv g ty g.uint32_ty then v - elif typeEquiv g ty g.int32_ty then mkInt32Val g (Unchecked.int32 a) + elif typeEquiv g ty g.int32_ty then mkInt32Val g (int32 a) else UnknownValue | ConstValue(Const.Int64 a, _) -> if typeEquiv g ty g.int64_ty then v - elif typeEquiv g ty g.uint64_ty then mkUInt64Val g (Unchecked.uint64 a) + elif typeEquiv g ty g.uint64_ty then mkUInt64Val g (uint64 a) else UnknownValue | ConstValue(Const.UInt64 a, _) -> if typeEquiv g ty g.uint64_ty then v - elif typeEquiv g ty g.int64_ty then mkInt64Val g (Unchecked.int64 a) + elif typeEquiv g ty g.int64_ty then mkInt64Val g (int64 a) else UnknownValue | _ -> UnknownValue | _ -> UnknownValue diff --git a/src/Compiler/Service/BackgroundCompiler.fs b/src/Compiler/Service/BackgroundCompiler.fs index 1b00bcb1ff1..62fe50b9b70 100644 --- a/src/Compiler/Service/BackgroundCompiler.fs +++ b/src/Compiler/Service/BackgroundCompiler.fs @@ -45,7 +45,7 @@ type FilePath = string type ProjectPath = string type FileVersion = int -type FSharpProjectSnapshot = FSharp.Compiler.CodeAnalysis.ProjectSnapshot.FSharpProjectSnapshot +type FSharpProjectSnapshot = ProjectSnapshot.FSharpProjectSnapshot type internal IBackgroundCompiler = @@ -80,22 +80,22 @@ type internal IBackgroundCompiler = abstract member FindReferencesInFile: fileName: string * options: FSharpProjectOptions * - symbol: FSharp.Compiler.Symbols.FSharpSymbol * + symbol: FSharpSymbol * canInvalidateProject: bool * userOpName: string -> - Async> + Async> abstract member FindReferencesInFile: - fileName: string * projectSnapshot: FSharpProjectSnapshot * symbol: FSharp.Compiler.Symbols.FSharpSymbol * userOpName: string -> - Async> + fileName: string * projectSnapshot: FSharpProjectSnapshot * symbol: FSharpSymbol * userOpName: string -> + Async> abstract member GetAssemblyData: options: FSharpProjectOptions * outputFileName: string * userOpName: string -> - Async + Async abstract member GetAssemblyData: projectSnapshot: FSharpProjectSnapshot * outputFileName: string * userOpName: string -> - Async + Async /// Fetch the check information from the background compiler (which checks w.r.t. the FileSystem API) abstract member GetBackgroundCheckResultsForFileInProject: @@ -114,7 +114,7 @@ type internal IBackgroundCompiler = sourceText: ISourceText * caret: Position option * previewEnabled: bool option * - loadedTimeStamp: System.DateTime option * + loadedTimeStamp: DateTime option * otherFlags: string array option * useFsiAuxLib: bool option * useSdkRefs: bool option * @@ -122,7 +122,7 @@ type internal IBackgroundCompiler = assumeDotNetFramework: bool option * optionsStamp: int64 option * userOpName: string -> - Async + Async abstract GetProjectSnapshotFromScript: fileName: string * @@ -130,7 +130,7 @@ type internal IBackgroundCompiler = caret: Position option * documentSource: DocumentSource * previewEnabled: bool option * - loadedTimeStamp: System.DateTime option * + loadedTimeStamp: DateTime option * otherFlags: string array option * useFsiAuxLib: bool option * useSdkRefs: bool option * diff --git a/src/Compiler/Service/FSharpCheckerResults.fs b/src/Compiler/Service/FSharpCheckerResults.fs index 0609fd8c6ce..5eefd6ef75c 100644 --- a/src/Compiler/Service/FSharpCheckerResults.fs +++ b/src/Compiler/Service/FSharpCheckerResults.fs @@ -3570,7 +3570,7 @@ type FSharpCheckFileResults | _ -> AccessibleFromSomewhere let layout = - NicePrint.layoutImpliedSignatureOfModuleOrNamespace true denv infoReader ad range0 mexpr + layoutImpliedSignatureOfModuleOrNamespace true denv infoReader ad range0 mexpr match pageWidth with | None -> layout diff --git a/src/Compiler/Service/IncrementalBuild.fsi b/src/Compiler/Service/IncrementalBuild.fsi index 0f8ed5582da..614792cad53 100644 --- a/src/Compiler/Service/IncrementalBuild.fsi +++ b/src/Compiler/Service/IncrementalBuild.fsi @@ -153,7 +153,7 @@ type internal RawFSharpAssemblyDataBackedByLanguageService = outfile: string * topAttrs: TopAttribs * assemblyName: string * - ilAssemRef: FSharp.Compiler.AbstractIL.IL.ILAssemblyRef -> + ilAssemRef: IL.ILAssemblyRef -> RawFSharpAssemblyDataBackedByLanguageService interface IRawFSharpAssemblyData diff --git a/src/Compiler/Service/ServiceAssemblyContent.fs b/src/Compiler/Service/ServiceAssemblyContent.fs index 8c58565125f..af87f73f0d4 100644 --- a/src/Compiler/Service/ServiceAssemblyContent.fs +++ b/src/Compiler/Service/ServiceAssemblyContent.fs @@ -17,7 +17,7 @@ open FSharp.Compiler.Syntax module Utils = let replaceLastIdentToDisplayName (idents: string array) (displayName: string) = - match idents |> Array.tryFindIndexBack (fun i -> displayName.StartsWith(i, System.StringComparison.Ordinal)) with + match idents |> Array.tryFindIndexBack (fun i -> displayName.StartsWith(i, StringComparison.Ordinal)) with | Some x when x = idents.Length - 1 -> idents |> Array.replace (idents.Length - 1) displayName | Some x -> let newIdents = Array.zeroCreate (x + 1) diff --git a/src/Compiler/Service/ServiceDeclarationLists.fs b/src/Compiler/Service/ServiceDeclarationLists.fs index 4c3fa338b60..9e55016aea5 100644 --- a/src/Compiler/Service/ServiceDeclarationLists.fs +++ b/src/Compiler/Service/ServiceDeclarationLists.fs @@ -107,7 +107,7 @@ module DeclarationListHelpers = let layouts = [ for minfo in minfos -> - let prettyTyparInst, layout = NicePrint.prettyLayoutOfMethInfoFreeStyle infoReader m denv item.TyparInstantiation minfo + let prettyTyparInst, layout = prettyLayoutOfMethInfoFreeStyle infoReader m denv item.TyparInstantiation minfo let xml = GetXmlCommentForMethInfoItem infoReader m item.Item minfo let tpsL = FormatTyparMapping denv prettyTyparInst let layout = PrintUtilities.squashToWidth width layout @@ -167,7 +167,7 @@ module DeclarationListHelpers = FormatItemDescriptionToToolTipElement displayFullName infoReader ad m denv { item with Item = Item.Value vref } symbol width | Item.Value vref | Item.CustomBuilder (_, vref) -> - let prettyTyparInst, resL = NicePrint.layoutQualifiedValOrMember denv infoReader item.TyparInstantiation vref + let prettyTyparInst, resL = layoutQualifiedValOrMember denv infoReader item.TyparInstantiation vref let remarks = OutputFullName displayFullName pubpathOfValRef fullDisplayTextOfValRefAsLayout vref let tpsL = FormatTyparMapping denv prettyTyparInst let tpsL = List.map toArray tpsL @@ -183,12 +183,12 @@ module DeclarationListHelpers = let recd = uc.RecdFields let layout = wordL (tagText (FSComp.SR.typeInfoUnionCase())) ^^ - NicePrint.layoutTyconRef denv ucinfo.TyconRef ^^ + layoutTyconRef denv ucinfo.TyconRef ^^ sepL (tagPunctuation ".") ^^ wordL (tagUnionCase (ConvertValLogicalNameToDisplayNameCore uc.Id.idText) |> mkNav uc.DefinitionRange) ^^ RightL.colon ^^ - (if List.isEmpty recd then emptyL else NicePrint.layoutUnionCases denv infoReader ucinfo.TyconRef recd ^^ WordL.arrow) ^^ - NicePrint.layoutType denv unionTy + (if List.isEmpty recd then emptyL else layoutUnionCases denv infoReader ucinfo.TyconRef recd ^^ WordL.arrow) ^^ + layoutType denv unionTy let layout = PrintUtilities.squashToWidth width layout let layout = toArray layout ToolTipElement.Single (layout, xml, ?symbol = symbol) @@ -200,7 +200,7 @@ module DeclarationListHelpers = wordL (tagText (FSComp.SR.typeInfoActivePatternResult())) ^^ wordL (tagActivePatternResult (List.item idx items) |> mkNav apinfo.Range) ^^ RightL.colon ^^ - NicePrint.layoutType denv ty + layoutType denv ty let layout = PrintUtilities.squashToWidth width layout let layout = toArray layout ToolTipElement.Single (layout, xml, ?symbol = symbol) @@ -216,7 +216,7 @@ module DeclarationListHelpers = wordL (tagText (FSComp.SR.typeInfoActiveRecognizer())) ^^ wordL (tagActivePatternCase apref.DisplayName |> mkNav v.DefinitionRange) ^^ RightL.colon ^^ - NicePrint.layoutType denv prettyTy + layoutType denv prettyTy let layout = PrintUtilities.squashToWidth width layout let tpsL = FormatTyparMapping denv prettyTyparInst @@ -228,7 +228,7 @@ module DeclarationListHelpers = // F# exception names | Item.ExnCase ecref -> - let layout = NicePrint.layoutExnDef denv infoReader ecref + let layout = layoutExnDef denv infoReader ecref let layout = PrintUtilities.squashToWidth width layout let remarks = OutputFullName displayFullName pubpathOfTyconRef fullDisplayTextOfExnRefAsLayout ecref let layout = toArray layout @@ -242,7 +242,7 @@ module DeclarationListHelpers = wordL (tagText (FSComp.SR.typeInfoArgument())) ^^ wordL (tagParameter id) ^^ RightL.colon ^^ - NicePrint.layoutType denv ty + layoutType denv ty let layout = PrintUtilities.squashToWidth width layout let layout = toArray layout ToolTipElement.Single (layout, xml, paramName = id, ?symbol = symbol) @@ -252,15 +252,15 @@ module DeclarationListHelpers = let rfield = rfinfo.RecdField let ty, _cxs = PrettyTypes.PrettifyType g rfinfo.FieldType let layout = - NicePrint.layoutTyconRef denv rfinfo.TyconRef ^^ + layoutTyconRef denv rfinfo.TyconRef ^^ SepL.dot ^^ wordL (tagRecordField rfield.DisplayName |> mkNav rfield.DefinitionRange) ^^ RightL.colon ^^ - NicePrint.layoutType denv ty ^^ + layoutType denv ty ^^ ( match rfinfo.LiteralValue with | None -> emptyL - | Some lit -> try WordL.equals ^^ NicePrint.layoutConst denv.g ty lit with _ -> emptyL + | Some lit -> try WordL.equals ^^ layoutConst denv.g ty lit with _ -> emptyL ) let layout = PrintUtilities.squashToWidth width layout let layout = toArray layout @@ -274,7 +274,7 @@ module DeclarationListHelpers = wordL (tagText (FSComp.SR.typeInfoArgument())) ^^ wordL (tagParameter id.idText) ^^ RightL.colon ^^ - NicePrint.layoutType denv fieldTy + layoutType denv fieldTy let layout = PrintUtilities.squashToWidth width layout let layout = toArray layout ToolTipElement.Single (layout, xml, paramName = id.idText, ?symbol = symbol) @@ -292,17 +292,17 @@ module DeclarationListHelpers = | Item.ILField finfo -> let layout = wordL (tagText (FSComp.SR.typeInfoField())) ^^ - NicePrint.layoutType denv finfo.ApparentEnclosingAppType ^^ + layoutType denv finfo.ApparentEnclosingAppType ^^ SepL.dot ^^ wordL (tagField finfo.FieldName) ^^ RightL.colon ^^ - NicePrint.layoutType denv (finfo.FieldType(amap, m)) ^^ + layoutType denv (finfo.FieldType(amap, m)) ^^ ( match finfo.LiteralValue with | None -> emptyL | Some v -> WordL.equals ^^ - try NicePrint.layoutConst denv.g (finfo.FieldType(infoReader.amap, m)) (CheckExpressions.TcFieldInit m v) with _ -> emptyL + try layoutConst denv.g (finfo.FieldType(infoReader.amap, m)) (CheckExpressions.TcFieldInit m v) with _ -> emptyL ) let layout = PrintUtilities.squashToWidth width layout let layout = toArray layout @@ -314,18 +314,18 @@ module DeclarationListHelpers = let eventTy, _cxs = PrettyTypes.PrettifyType g eventTy let layout = wordL (tagText (FSComp.SR.typeInfoEvent())) ^^ - NicePrint.layoutTyconRef denv einfo.ApparentEnclosingTyconRef ^^ + layoutTyconRef denv einfo.ApparentEnclosingTyconRef ^^ SepL.dot ^^ wordL (tagEvent einfo.EventName) ^^ RightL.colon ^^ - NicePrint.layoutType denv eventTy + layoutType denv eventTy let layout = PrintUtilities.squashToWidth width layout let layout = toArray layout ToolTipElement.Single (layout, xml, ?symbol = symbol) // F# and .NET properties | Item.Property(info = pinfo :: _) -> - let layout = NicePrint.prettyLayoutOfPropInfoFreeStyle g amap m denv pinfo + let layout = prettyLayoutOfPropInfoFreeStyle g amap m denv pinfo let layout = PrintUtilities.squashToWidth width layout let layout = toArray layout ToolTipElement.Single (layout, xml, ?symbol = symbol) @@ -345,11 +345,11 @@ module DeclarationListHelpers = | None -> let argTys = ParamNameAndTypesOfUnaryCustomOperation g minfo |> List.map (fun (ParamNameAndType(_, ty)) -> ty) let argTys, _ = PrettyTypes.PrettifyTypes g argTys - wordL (tagMethod customOpName) ^^ sepListL SepL.space (List.map (fun ty -> LeftL.leftParen ^^ NicePrint.layoutType denv ty ^^ SepL.rightParen) argTys) + wordL (tagMethod customOpName) ^^ sepListL SepL.space (List.map (fun ty -> LeftL.leftParen ^^ layoutType denv ty ^^ SepL.rightParen) argTys) ) ^^ SepL.lineBreak ^^ SepL.lineBreak ^^ wordL (tagText (FSComp.SR.typeInfoCallsWord())) ^^ - NicePrint.layoutTyconRef denv minfo.ApparentEnclosingTyconRef ^^ + layoutTyconRef denv minfo.ApparentEnclosingTyconRef ^^ SepL.dot ^^ wordL (tagMethod minfo.DisplayName) @@ -367,9 +367,9 @@ module DeclarationListHelpers = let delTy, _cxs = PrettyTypes.PrettifyType g delTy let (SigOfFunctionForDelegate(_, _, _, delFuncTy)) = GetSigOfFunctionForDelegate infoReader delTy m AccessibleFromSomewhere let layout = - NicePrint.layoutTyconRef denv (tcrefOfAppTy g delTy) ^^ + layoutTyconRef denv (tcrefOfAppTy g delTy) ^^ LeftL.leftParen ^^ - NicePrint.layoutType denv delFuncTy ^^ + layoutType denv delFuncTy ^^ RightL.rightParen let layout = PrintUtilities.squashToWidth width layout let layout = toArray layout @@ -385,7 +385,7 @@ module DeclarationListHelpers = // on types/members. The doc comments for the actual member will still // be shown in the tip. showDocumentation = false } - let layout = NicePrint.layoutTyconDefn denv infoReader ad m (* width *) tcref.Deref + let layout = layoutTyconDefn denv infoReader ad m (* width *) tcref.Deref let layout = PrintUtilities.squashToWidth width layout let remarks = OutputFullName displayFullName pubpathOfTyconRef fullDisplayTextOfTyconRefAsLayout tcref let layout = toArray layout @@ -394,14 +394,14 @@ module DeclarationListHelpers = // Type variables | Item.TypeVar (_, typar) -> - let layout = NicePrint.prettyLayoutOfTypar denv typar + let layout = prettyLayoutOfTypar denv typar let layout = PrintUtilities.squashToWidth width layout ToolTipElement.Single (toArray layout, xml, ?symbol = symbol) // Traits | Item.Trait traitInfo -> let denv = { denv with shortConstraints = false} - let layout = NicePrint.prettyLayoutOfTrait denv traitInfo + let layout = prettyLayoutOfTrait denv traitInfo let layout = PrintUtilities.squashToWidth width layout ToolTipElement.Single (toArray layout, xml, ?symbol = symbol) @@ -458,7 +458,7 @@ module DeclarationListHelpers = wordL (tagText (FSComp.SR.typeInfoAnonRecdField())) ^^ wordL (tagRecordField nm) ^^ RightL.colon ^^ - NicePrint.layoutType denv argTy + layoutType denv argTy let layout = PrintUtilities.squashToWidth width layout let layout = toArray layout ToolTipElement.Single (layout, FSharpXmlDoc.None, ?symbol = symbol) @@ -470,7 +470,7 @@ module DeclarationListHelpers = wordL (tagText (FSComp.SR.typeInfoArgument())) ^^ wordL (tagParameter id.idText) ^^ RightL.colon ^^ - NicePrint.layoutType denv argTy + layoutType denv argTy let layout = PrintUtilities.squashToWidth width layout let layout = toArray layout ToolTipElement.Single (layout, xml, paramName = id.idText, ?symbol = symbol) @@ -553,10 +553,10 @@ module internal DescriptionListsImpl = // pretend no namespaces are open let denv = denv.SetOpenPaths([]) // now printing will see a .NET-like canonical representation, that is good for sorting overloads into a reasonable order (see bug 94520) - NicePrint.stringOfTy denv strippedTy + stringOfTy denv strippedTy let PrettyParamOfRecdField g denv (f: RecdField) = - let display = NicePrint.prettyLayoutOfType denv f.FormalType + let display = prettyLayoutOfType denv f.FormalType let display = toArray display MethodGroupItemParameter( name = f.DisplayNameCore, @@ -570,7 +570,7 @@ module internal DescriptionListsImpl = if isGenerated i f then initial.Display else - let display = NicePrint.layoutOfParamData denv (ParamData(false, false, false, NotOptional, NoCallerInfo, Some f.Id, ReflectedArgInfo.None, f.FormalType)) + let display = layoutOfParamData denv (ParamData(false, false, false, NotOptional, NoCallerInfo, Some f.Id, ReflectedArgInfo.None, f.FormalType)) toArray display MethodGroupItemParameter( @@ -580,7 +580,7 @@ module internal DescriptionListsImpl = isOptional=false) let ParamOfParamData g denv (ParamData(_isParamArrayArg, _isInArg, _isOutArg, optArgInfo, _callerInfo, nmOpt, _reflArgInfo, pty) as paramData) = - let display = NicePrint.layoutOfParamData denv paramData + let display = layoutOfParamData denv paramData let display = toArray display MethodGroupItemParameter( name = (match nmOpt with None -> "" | Some pn -> pn.idText), @@ -609,7 +609,7 @@ module internal DescriptionListsImpl = let nm = id.idText let prefix = if isParamArrayArg then - NicePrint.PrintUtilities.layoutBuiltinAttribute denv denv.g.attrib_ParamArrayAttribute ^^ + PrintUtilities.layoutBuiltinAttribute denv denv.g.attrib_ParamArrayAttribute ^^ wordL (tagParameter nm) ^^ RightL.colon //sprintf "%s %s: " (NicePrint.PrintUtilities.layoutBuiltinAttribute denv denv.g.attrib_ParamArrayAttribute |> showL) nm @@ -622,7 +622,7 @@ module internal DescriptionListsImpl = // Prettify everything let prettyTyparInst, (prettyParamTys, _prettyRetTy), (prettyParamTysL, prettyRetTyL), prettyConstraintsL = - NicePrint.prettyLayoutOfInstAndSig denv (typarInst, paramTypes, paramTy) + prettyLayoutOfInstAndSig denv (typarInst, paramTypes, paramTy) // Remake the params using the prettified versions let prettyParams = @@ -642,7 +642,7 @@ module internal DescriptionListsImpl = // Prettify everything let prettyTyparInst, (prettyParamTys, _prettyRetTy), (prettyParamTysL, prettyRetTyL), prettyConstraintsL = - NicePrint.prettyLayoutOfInstAndSig denv (typarInst, paramTys, retTy) + prettyLayoutOfInstAndSig denv (typarInst, paramTys, retTy) // Remake the params using the prettified versions let parameters = @@ -671,7 +671,7 @@ module internal DescriptionListsImpl = staticParameters |> Array.map (fun sp -> let ty = Import.ImportProvidedType amap m (sp.PApply((fun x -> x.ParameterType), m)) - let spKind = NicePrint.prettyLayoutOfType denv ty + let spKind = prettyLayoutOfType denv ty let spName = sp.PUntaint((fun sp -> sp.Name), m) let spOpt = sp.PUntaint((fun sp -> sp.IsOptional), m) let display = (if spOpt then SepL.questionMark else emptyL) ^^ wordL (tagParameter spName) ^^ RightL.colon ^^ spKind @@ -706,7 +706,7 @@ module internal DescriptionListsImpl = // for display as part of the method group prettyParams, prettyRetTyL | _ -> - let _prettyTyparInst, prettyTyL = NicePrint.prettyLayoutOfUncurriedSig denv item.TyparInstantiation [] vTauTy + let _prettyTyparInst, prettyTyL = prettyLayoutOfUncurriedSig denv item.TyparInstantiation [] vTauTy [], prettyTyL match vref.ValReprInfo with @@ -747,10 +747,10 @@ module internal DescriptionListsImpl = | Item.UnionCase(ucinfo, _) -> let prettyParams = match ucinfo.UnionCase.RecdFields with - | [f] -> [PrettyParamOfUnionCaseField g denv NicePrint.isGeneratedUnionCaseField -1 f] - | fs -> fs |> List.mapi (PrettyParamOfUnionCaseField g denv NicePrint.isGeneratedUnionCaseField) + | [f] -> [PrettyParamOfUnionCaseField g denv isGeneratedUnionCaseField -1 f] + | fs -> fs |> List.mapi (PrettyParamOfUnionCaseField g denv isGeneratedUnionCaseField) let unionTy = generalizedTyconRef g ucinfo.TyconRef - let rtyL = NicePrint.layoutType denv unionTy + let rtyL = layoutType denv unionTy prettyParams, rtyL | Item.ActivePatternCase(apref) -> @@ -769,24 +769,24 @@ module internal DescriptionListsImpl = prettyParams, prettyRetTyL | Item.ExnCase ecref -> - let prettyParams = ecref |> recdFieldsOfExnDefRef |> List.mapi (PrettyParamOfUnionCaseField g denv NicePrint.isGeneratedExceptionField) - let _prettyTyparInst, prettyRetTyL = NicePrint.prettyLayoutOfUncurriedSig denv item.TyparInstantiation [] g.exn_ty + let prettyParams = ecref |> recdFieldsOfExnDefRef |> List.mapi (PrettyParamOfUnionCaseField g denv isGeneratedExceptionField) + let _prettyTyparInst, prettyRetTyL = prettyLayoutOfUncurriedSig denv item.TyparInstantiation [] g.exn_ty prettyParams, prettyRetTyL | Item.RecdField rfinfo -> - let _prettyTyparInst, prettyRetTyL = NicePrint.prettyLayoutOfUncurriedSig denv item.TyparInstantiation [] rfinfo.FieldType + let _prettyTyparInst, prettyRetTyL = prettyLayoutOfUncurriedSig denv item.TyparInstantiation [] rfinfo.FieldType [], prettyRetTyL | Item.AnonRecdField(_anonInfo, tys, i, _) -> - let _prettyTyparInst, prettyRetTyL = NicePrint.prettyLayoutOfUncurriedSig denv item.TyparInstantiation [] tys[i] + let _prettyTyparInst, prettyRetTyL = prettyLayoutOfUncurriedSig denv item.TyparInstantiation [] tys[i] [], prettyRetTyL | Item.ILField finfo -> - let _prettyTyparInst, prettyRetTyL = NicePrint.prettyLayoutOfUncurriedSig denv item.TyparInstantiation [] (finfo.FieldType(amap, m)) + let _prettyTyparInst, prettyRetTyL = prettyLayoutOfUncurriedSig denv item.TyparInstantiation [] (finfo.FieldType(amap, m)) [], prettyRetTyL | Item.Event einfo -> - let _prettyTyparInst, prettyRetTyL = NicePrint.prettyLayoutOfUncurriedSig denv item.TyparInstantiation [] (PropTypeOfEventInfo infoReader m AccessibleFromSomewhere einfo) + let _prettyTyparInst, prettyRetTyL = prettyLayoutOfUncurriedSig denv item.TyparInstantiation [] (PropTypeOfEventInfo infoReader m AccessibleFromSomewhere einfo) [], prettyRetTyL | Item.Property(info = pinfo :: _) -> @@ -836,7 +836,7 @@ module internal DescriptionListsImpl = | Some _ -> let retTy = minfo.GetFSharpReturnType(amap, m, minfo.FormalMethodInst) - let _prettyTyparInst, prettyRetTyL = NicePrint.prettyLayoutOfUncurriedSig denv item.TyparInstantiation [] retTy + let _prettyTyparInst, prettyRetTyL = prettyLayoutOfUncurriedSig denv item.TyparInstantiation [] retTy [], prettyRetTyL // no parameter data available for binary operators like 'zip', 'join' and 'groupJoin' since they use bespoke syntax | Item.DelegateCtor delTy -> diff --git a/src/Compiler/Service/ServiceLexing.fs b/src/Compiler/Service/ServiceLexing.fs index 74141b4805d..1a2272a6868 100644 --- a/src/Compiler/Service/ServiceLexing.fs +++ b/src/Compiler/Service/ServiceLexing.fs @@ -1286,7 +1286,7 @@ module FSharpKeywords = | false, _ -> None | true, desc -> Some desc - let KeywordNames = Lexhelp.Keywords.keywordNames + let KeywordNames = Keywords.keywordNames [] type FSharpLexerFlags = diff --git a/src/Compiler/Service/TransparentCompiler.fs b/src/Compiler/Service/TransparentCompiler.fs index 0c3f01d4a3a..889749fc150 100644 --- a/src/Compiler/Service/TransparentCompiler.fs +++ b/src/Compiler/Service/TransparentCompiler.fs @@ -345,7 +345,7 @@ type internal CompilerCaches(cacheSizes: CacheSizes) = member val ParseFile = AsyncMemoize(keepStrongly = cs.ParseFileKeepStrongly, keepWeakly = cs.ParseFileKeepWeakly, name = "ParseFile") - : AsyncMemoize<(FSharpProjectIdentifier * string), (string * string * bool), ProjectSnapshot.FSharpParsedFile> + : AsyncMemoize<(FSharpProjectIdentifier * string), (string * string * bool), FSharpParsedFile> member val ParseFileWithoutProject = AsyncMemoize( @@ -2493,7 +2493,7 @@ type internal TransparentCompiler member this.GetSemanticClassificationForFile (fileName: string, options: FSharpProjectOptions, userOpName: string) - : Async = + : Async = async { ignore userOpName diff --git a/src/Compiler/Service/TransparentCompiler.fsi b/src/Compiler/Service/TransparentCompiler.fsi index 8703df0fe7f..037b2ac89e7 100644 --- a/src/Compiler/Service/TransparentCompiler.fsi +++ b/src/Compiler/Service/TransparentCompiler.fsi @@ -74,7 +74,7 @@ type internal BootstrapInfo = TcImports: TcImports TcGlobals: TcGlobals InitialTcInfo: TcInfo - LoadedSources: (range * ProjectSnapshot.FSharpFileSnapshot) list + LoadedSources: (range * FSharpFileSnapshot) list LoadClosure: LoadClosure option LastFileName: string ImportsInvalidatedByTypeProvider: Event } @@ -95,7 +95,7 @@ type internal Extensions = [] static member Key: - fileSnapshots: #ProjectSnapshot.IFileSnapshot list * ?extraKeyFlag: DependencyGraphType -> + fileSnapshots: #IFileSnapshot list * ?extraKeyFlag: DependencyGraphType -> ICacheKey<(DependencyGraphType option * byte array), string> [] @@ -165,7 +165,7 @@ type internal CompilerCaches = member ParseAndCheckProject: AsyncMemoize member ParseFile: - AsyncMemoize<(FSharpProjectIdentifier * string), (string * string * bool), ProjectSnapshot.FSharpParsedFile> + AsyncMemoize<(FSharpProjectIdentifier * string), (string * string * bool), FSharpParsedFile> member ParseFileWithoutProject: AsyncMemoize diff --git a/src/Compiler/SyntaxTree/LexFilter.fs b/src/Compiler/SyntaxTree/LexFilter.fs index e74f514f812..abb14ce6b70 100644 --- a/src/Compiler/SyntaxTree/LexFilter.fs +++ b/src/Compiler/SyntaxTree/LexFilter.fs @@ -2735,7 +2735,7 @@ type LexFilterImpl ( | NATIVEINT(v, bad) -> delayMergedToken(NATIVEINT((if plus then v else -v), (plus && bad))) // note: '-' makes a 'bad' max int 'good'. '+' does not | IEEE32 v -> delayMergedToken(IEEE32(if plus then v else -v)) | IEEE64 v -> delayMergedToken(IEEE64(if plus then v else -v)) - | DECIMAL v -> delayMergedToken(DECIMAL(if plus then v else System.Decimal.op_UnaryNegation v)) + | DECIMAL v -> delayMergedToken(DECIMAL(if plus then v else Decimal.op_UnaryNegation v)) | BIGNUM(v, s) -> delayMergedToken(BIGNUM((if plus then v else "-" + v), s)) | _ -> noMerge() else diff --git a/src/Compiler/SyntaxTree/ParseHelpers.fs b/src/Compiler/SyntaxTree/ParseHelpers.fs index 572600f9ff9..e1c4bbecebf 100644 --- a/src/Compiler/SyntaxTree/ParseHelpers.fs +++ b/src/Compiler/SyntaxTree/ParseHelpers.fs @@ -687,7 +687,7 @@ let mkSynTypeTuple (elementTypes: SynTupleTypeSegment list) : SynType = #if DEBUG let debugPrint s = - if Internal.Utilities.Text.Parsing.Flags.debug then + if Flags.debug then printfn "\n%s" s #else let debugPrint s = ignore s @@ -1143,7 +1143,7 @@ let mkLetExpression let mIn' = mIn |> Option.bind (fun (mIn: range) -> - if Position.posEq mIn.Start body.Range.Start then + if posEq mIn.Start body.Range.Start then None else Some mIn) diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fs b/src/Compiler/SyntaxTree/SyntaxTree.fs index c41e483e27a..5fe80f13029 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fs +++ b/src/Compiler/SyntaxTree/SyntaxTree.fs @@ -160,7 +160,7 @@ type SynConst = | Char of char - | Decimal of System.Decimal + | Decimal of Decimal | UserNum of value: string * suffix: string diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fsi b/src/Compiler/SyntaxTree/SyntaxTree.fsi index 819b0b384f2..16745c78736 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTree.fsi @@ -152,7 +152,7 @@ type SynConst = | Char of char /// F# syntax: 23.4M - | Decimal of System.Decimal + | Decimal of Decimal /// UserNum(value, suffix) /// diff --git a/src/Compiler/SyntaxTree/SyntaxTreeOps.fs b/src/Compiler/SyntaxTree/SyntaxTreeOps.fs index 5669b0cd087..de86ebef627 100644 --- a/src/Compiler/SyntaxTree/SyntaxTreeOps.fs +++ b/src/Compiler/SyntaxTree/SyntaxTreeOps.fs @@ -993,7 +993,7 @@ let rec synExprContainsError inpExpr = walkExpr inpExpr let longIdentToString (ident: SynLongIdent) = - System.String.Join(".", ident.LongIdent |> List.map (fun ident -> ident.idText.ToString())) + String.Join(".", ident.LongIdent |> List.map (fun ident -> ident.idText.ToString())) /// The "mock" file name used by fsi.exe when reading from stdin. /// Has special treatment, i.e. __SOURCE_DIRECTORY__ becomes GetCurrentDirectory() @@ -1133,9 +1133,9 @@ let (|MultiDimensionArrayType|_|) (t: SynType) = if System.Text.RegularExpressions.Regex.IsMatch(identifier.idText, "^array\d\d?d$") then let rank = identifier.idText - |> Seq.filter System.Char.IsDigit + |> Seq.filter Char.IsDigit |> Seq.toArray - |> System.String + |> String |> int ValueSome(rank, elementType, m) @@ -1158,7 +1158,7 @@ let (|Get_OrSet_Ident|_|) (ident: Ident) = elif ident.idText.StartsWithOrdinal("set_") then ValueSome() else ValueNone -let getGetterSetterAccess synValSigAccess memberKind (langVersion: Features.LanguageVersion) = +let getGetterSetterAccess synValSigAccess memberKind (langVersion: LanguageVersion) = match synValSigAccess with | SynValSigAccess.Single(access) -> access, access | SynValSigAccess.GetSet(access, getterAccess, setterAccess) -> @@ -1171,7 +1171,7 @@ let getGetterSetterAccess synValSigAccess memberKind (langVersion: Features.Lang | Some x, None -> checkLanguageFeatureAndRecover langVersion - Features.LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters + LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters x.Range accessBeforeGetSet @@ -1184,7 +1184,7 @@ let getGetterSetterAccess synValSigAccess memberKind (langVersion: Features.Lang | None, (_, Some x) -> checkLanguageFeatureAndRecover langVersion - Features.LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters + LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters x.Range getterAccess, setterAccess diff --git a/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi b/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi index 3365349bdb0..43c59628e35 100644 --- a/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi @@ -375,7 +375,7 @@ val (|TypesForTypar|): t: SynType -> SynType list val (|Get_OrSet_Ident|_|): Ident -> unit voption val getGetterSetterAccess: - SynValSigAccess -> SynMemberKind -> Features.LanguageVersion -> SynAccess option * SynAccess option + SynValSigAccess -> SynMemberKind -> LanguageVersion -> SynAccess option * SynAccess option /// Adds SynPat.Or pattern for unfinished empty clause above val addEmptyMatchClause: mBar1: range -> mBar2: range -> clauses: SynMatchClause list -> SynMatchClause list diff --git a/src/Compiler/SyntaxTree/SyntaxTrivia.fs b/src/Compiler/SyntaxTree/SyntaxTrivia.fs index 53ac39d5365..6734010660c 100644 --- a/src/Compiler/SyntaxTree/SyntaxTrivia.fs +++ b/src/Compiler/SyntaxTree/SyntaxTrivia.fs @@ -184,7 +184,7 @@ type SynTypeDefnLeadingKeyword = match this with | SynTypeDefnLeadingKeyword.Type range | SynTypeDefnLeadingKeyword.And range -> range - | SynTypeDefnLeadingKeyword.StaticType(staticRange, typeRange) -> Range.unionRanges staticRange typeRange + | SynTypeDefnLeadingKeyword.StaticType(staticRange, typeRange) -> unionRanges staticRange typeRange | SynTypeDefnLeadingKeyword.Synthetic -> failwith "Getting range from synthetic keyword" [] @@ -274,7 +274,7 @@ type SynLeadingKeyword = | DefaultVal(m1, m2) | MemberVal(m1, m2) | OverrideVal(m1, m2) - | StaticMemberVal(m1, _, m2) -> Range.unionRanges m1 m2 + | StaticMemberVal(m1, _, m2) -> unionRanges m1 m2 | Synthetic -> range0 [] @@ -383,10 +383,10 @@ type GetSetKeywords = | Get m | Set m -> m | GetSet(mG, mS) -> - if Range.rangeBeforePos mG mS.Start then - Range.unionRanges mG mS + if rangeBeforePos mG mS.Start then + unionRanges mG mS else - Range.unionRanges mS mG + unionRanges mS mG [] type SynMemberDefnAutoPropertyTrivia = diff --git a/src/Compiler/TypedTree/CompilerGlobalState.fs b/src/Compiler/TypedTree/CompilerGlobalState.fs index 12dda2b08d8..44f4548e501 100644 --- a/src/Compiler/TypedTree/CompilerGlobalState.fs +++ b/src/Compiler/TypedTree/CompilerGlobalState.fs @@ -68,11 +68,11 @@ type Unique = int64 //++GLOBAL MUTABLE STATE (concurrency-safe) let mutable private uniqueCount = 0L -let newUnique() = System.Threading.Interlocked.Increment &uniqueCount +let newUnique() = Interlocked.Increment &uniqueCount /// Unique name generator for stamps attached to to val_specs, tycon_specs etc. //++GLOBAL MUTABLE STATE (concurrency-safe) let mutable private stampCount = 0L let newStamp() = - let stamp = System.Threading.Interlocked.Increment &stampCount + let stamp = Interlocked.Increment &stampCount stamp \ No newline at end of file diff --git a/src/Compiler/TypedTree/TcGlobals.fs b/src/Compiler/TypedTree/TcGlobals.fs index 9999b801606..f9dcf0ad7b2 100644 --- a/src/Compiler/TypedTree/TcGlobals.fs +++ b/src/Compiler/TypedTree/TcGlobals.fs @@ -192,7 +192,7 @@ type TcGlobals( checkNullness: bool, useReflectionFreeCodeGen: bool, // The helper to find system types amongst referenced DLLs - tryFindSysTypeCcuHelper: string list -> string -> bool -> FSharp.Compiler.TypedTree.CcuThunk option, + tryFindSysTypeCcuHelper: string list -> string -> bool -> CcuThunk option, emitDebugInfoInQuotations: bool, noDebugAttributes: bool, pathMap: PathMap, @@ -1112,7 +1112,7 @@ type TcGlobals( member _.noDebugAttributes = noDebugAttributes - member _.tryFindSysTypeCcuHelper: string list -> string -> bool -> FSharp.Compiler.TypedTree.CcuThunk option = tryFindSysTypeCcuHelper + member _.tryFindSysTypeCcuHelper: string list -> string -> bool -> CcuThunk option = tryFindSysTypeCcuHelper member _.tryRemoveEmbeddedILTypeDefs () = [ for key in embeddedILTypeDefs.Keys.OrderBy id do diff --git a/src/Compiler/TypedTree/TcGlobals.fsi b/src/Compiler/TypedTree/TcGlobals.fsi index f4b866d8fbc..236572e2457 100644 --- a/src/Compiler/TypedTree/TcGlobals.fsi +++ b/src/Compiler/TypedTree/TcGlobals.fsi @@ -17,11 +17,11 @@ val internal DummyFileNameForRangesWithoutASpecificLocation: string [] type internal IntrinsicValRef = | IntrinsicValRef of - FSharp.Compiler.TypedTree.NonLocalEntityRef * + TypedTree.NonLocalEntityRef * string * bool * - FSharp.Compiler.TypedTree.TType * - FSharp.Compiler.TypedTree.ValLinkageFullKey + TypedTree.TType * + TypedTree.ValLinkageFullKey /// For debugging override ToString: unit -> string @@ -32,7 +32,7 @@ type internal IntrinsicValRef = member Name: string -val internal ValRefForIntrinsic: IntrinsicValRef -> FSharp.Compiler.TypedTree.ValRef +val internal ValRefForIntrinsic: IntrinsicValRef -> TypedTree.ValRef [] module internal FSharpLib = @@ -91,7 +91,7 @@ module internal FSharpLib = [] type internal BuiltinAttribInfo = - | AttribInfo of FSharp.Compiler.AbstractIL.IL.ILTypeRef * FSharp.Compiler.TypedTree.TyconRef + | AttribInfo of FSharp.Compiler.AbstractIL.IL.ILTypeRef * TypedTree.TyconRef /// For debugging override ToString: unit -> string @@ -100,7 +100,7 @@ type internal BuiltinAttribInfo = [ (0))>] member DebugText: string - member TyconRef: FSharp.Compiler.TypedTree.TyconRef + member TyconRef: TypedTree.TyconRef member TypeRef: FSharp.Compiler.AbstractIL.IL.ILTypeRef @@ -145,17 +145,17 @@ type internal TcGlobals = new: compilingFSharpCore: bool * ilg: FSharp.Compiler.AbstractIL.IL.ILGlobals * - fslibCcu: FSharp.Compiler.TypedTree.CcuThunk * + fslibCcu: TypedTree.CcuThunk * directoryToResolveRelativePaths: string * mlCompatibility: bool * isInteractive: bool * checkNullness: bool * useReflectionFreeCodeGen: bool * - tryFindSysTypeCcuHelper: (string list -> string -> bool -> FSharp.Compiler.TypedTree.CcuThunk option) * + tryFindSysTypeCcuHelper: (string list -> string -> bool -> TypedTree.CcuThunk option) * emitDebugInfoInQuotations: bool * noDebugAttributes: bool * pathMap: Internal.Utilities.PathMap * - langVersion: FSharp.Compiler.Features.LanguageVersion * + langVersion: Features.LanguageVersion * realsig: bool * compilationMode: CompilationMode -> TcGlobals @@ -166,7 +166,7 @@ type internal TcGlobals = member noDebugAttributes: bool - member tryFindSysTypeCcuHelper: (string list -> string -> bool -> FSharp.Compiler.TypedTree.CcuThunk option) with get + member tryFindSysTypeCcuHelper: (string list -> string -> bool -> TypedTree.CcuThunk option) with get member AddFieldGeneratedAttributes: mdef: FSharp.Compiler.AbstractIL.IL.ILFieldDef -> FSharp.Compiler.AbstractIL.IL.ILFieldDef @@ -186,22 +186,22 @@ type internal TcGlobals = member AddPropertyNeverAttributes: mdef: FSharp.Compiler.AbstractIL.IL.ILPropertyDef -> FSharp.Compiler.AbstractIL.IL.ILPropertyDef - member AddValGeneratedAttributes: v: FSharp.Compiler.TypedTree.Val -> (FSharp.Compiler.Text.range -> unit) + member AddValGeneratedAttributes: v: TypedTree.Val -> (FSharp.Compiler.Text.range -> unit) member FindSysAttrib: nm: string -> BuiltinAttribInfo member FindSysILTypeRef: nm: string -> FSharp.Compiler.AbstractIL.IL.ILTypeRef - member isSpliceOperator: FSharp.Compiler.TypedTree.ValRef -> bool + member isSpliceOperator: TypedTree.ValRef -> bool - member FindSysTyconRef: path: string list -> nm: string -> FSharp.Compiler.TypedTree.EntityRef + member FindSysTyconRef: path: string list -> nm: string -> TypedTree.EntityRef - member HasTailCallAttrib: attribs: FSharp.Compiler.TypedTree.Attribs -> bool + member HasTailCallAttrib: attribs: TypedTree.Attribs -> bool /// Find an FSharp.Core LanguagePrimitives dynamic function that corresponds to a trait witness, e.g. /// AdditionDynamic for op_Addition. Also work out the type instantiation of the dynamic function. member MakeBuiltInWitnessInfo: - t: FSharp.Compiler.TypedTree.TraitConstraintInfo -> IntrinsicValRef * FSharp.Compiler.TypedTree.TType list + t: TypedTree.TraitConstraintInfo -> IntrinsicValRef * TypedTree.TType list member MakeInternalsVisibleToAttribute: simpleAssemName: string -> FSharp.Compiler.AbstractIL.IL.ILAttribute @@ -217,25 +217,25 @@ type internal TcGlobals = member TryFindSysILTypeRef: nm: string -> FSharp.Compiler.AbstractIL.IL.ILTypeRef option - member TryFindSysTyconRef: path: string list -> nm: string -> FSharp.Compiler.TypedTree.EntityRef option + member TryFindSysTyconRef: path: string list -> nm: string -> TypedTree.EntityRef option /// Find an FSharp.Core operator that corresponds to a trait witness member TryMakeOperatorAsBuiltInWitnessInfo: - isStringTy: (TcGlobals -> FSharp.Compiler.TypedTree.TType -> bool) -> - isArrayTy: (TcGlobals -> FSharp.Compiler.TypedTree.TType -> bool) -> - t: FSharp.Compiler.TypedTree.TraitConstraintInfo -> + isStringTy: (TcGlobals -> TypedTree.TType -> bool) -> + isArrayTy: (TcGlobals -> TypedTree.TType -> bool) -> + t: TypedTree.TraitConstraintInfo -> argExprs: 'a list -> - (IntrinsicValRef * FSharp.Compiler.TypedTree.TType list * 'a list) option + (IntrinsicValRef * TypedTree.TType list * 'a list) option member decompileType: - tcref: FSharp.Compiler.TypedTree.EntityRef -> - tinst: FSharp.Compiler.TypedTree.TypeInst -> - (FSharp.Compiler.TypedTree.Nullness -> FSharp.Compiler.TypedTree.TType) + tcref: TypedTree.EntityRef -> + tinst: TypedTree.TypeInst -> + (TypedTree.Nullness -> TypedTree.TType) member improveType: - tcref: FSharp.Compiler.TypedTree.EntityRef -> - tinst: FSharp.Compiler.TypedTree.TType list -> - (FSharp.Compiler.TypedTree.Nullness -> FSharp.Compiler.TypedTree.TType) + tcref: TypedTree.EntityRef -> + tinst: TypedTree.TType list -> + (TypedTree.Nullness -> TypedTree.TType) /// Memoization table to help minimize the number of ILSourceDocument objects we create member memoize_file: x: int -> FSharp.Compiler.AbstractIL.IL.ILSourceDocument @@ -245,80 +245,80 @@ type internal TcGlobals = member mkDebuggerDisplayAttribute: s: string -> FSharp.Compiler.AbstractIL.IL.ILAttribute - member mk_ArrayCollector_ty: seqElemTy: FSharp.Compiler.TypedTree.TType -> FSharp.Compiler.TypedTree.TType + member mk_ArrayCollector_ty: seqElemTy: TypedTree.TType -> TypedTree.TType - member mk_GeneratedSequenceBase_ty: seqElemTy: FSharp.Compiler.TypedTree.TType -> FSharp.Compiler.TypedTree.TType + member mk_GeneratedSequenceBase_ty: seqElemTy: TypedTree.TType -> TypedTree.TType - member mk_IResumableStateMachine_ty: dataTy: FSharp.Compiler.TypedTree.TType -> FSharp.Compiler.TypedTree.TType + member mk_IResumableStateMachine_ty: dataTy: TypedTree.TType -> TypedTree.TType - member mk_ListCollector_ty: seqElemTy: FSharp.Compiler.TypedTree.TType -> FSharp.Compiler.TypedTree.TType + member mk_ListCollector_ty: seqElemTy: TypedTree.TType -> TypedTree.TType - member mk_ResumableStateMachine_ty: dataTy: FSharp.Compiler.TypedTree.TType -> FSharp.Compiler.TypedTree.TType + member mk_ResumableStateMachine_ty: dataTy: TypedTree.TType -> TypedTree.TType member tryRemoveEmbeddedILTypeDefs: unit -> FSharp.Compiler.AbstractIL.IL.ILTypeDef list member unionCaseRefEq: - x: FSharp.Compiler.TypedTree.UnionCaseRef -> y: FSharp.Compiler.TypedTree.UnionCaseRef -> bool + x: TypedTree.UnionCaseRef -> y: TypedTree.UnionCaseRef -> bool - member valRefEq: x: FSharp.Compiler.TypedTree.ValRef -> y: FSharp.Compiler.TypedTree.ValRef -> bool + member valRefEq: x: TypedTree.ValRef -> y: TypedTree.ValRef -> bool member CompilerGeneratedAttribute: FSharp.Compiler.AbstractIL.IL.ILAttribute - member CompilerGlobalState: FSharp.Compiler.CompilerGlobalState.CompilerGlobalState option + member CompilerGlobalState: CompilerGlobalState.CompilerGlobalState option member DebuggerBrowsableNeverAttribute: FSharp.Compiler.AbstractIL.IL.ILAttribute member DebuggerNonUserCodeAttribute: FSharp.Compiler.AbstractIL.IL.ILAttribute - member IComparer_ty: FSharp.Compiler.TypedTree.TType + member IComparer_ty: TypedTree.TType - member IEqualityComparer_ty: FSharp.Compiler.TypedTree.TType + member IEqualityComparer_ty: TypedTree.TType - member ListCollector_tcr: FSharp.Compiler.TypedTree.EntityRef + member ListCollector_tcr: TypedTree.EntityRef - member SupportsWhenTEnum_tcr: FSharp.Compiler.TypedTree.EntityRef + member SupportsWhenTEnum_tcr: TypedTree.EntityRef - member MatchFailureException_tcr: FSharp.Compiler.TypedTree.EntityRef + member MatchFailureException_tcr: TypedTree.EntityRef - member ResumableCode_tcr: FSharp.Compiler.TypedTree.EntityRef + member ResumableCode_tcr: TypedTree.EntityRef - member System_Runtime_CompilerServices_RuntimeFeature_ty: FSharp.Compiler.TypedTree.TType option + member System_Runtime_CompilerServices_RuntimeFeature_ty: TypedTree.TType option - member addrof2_vref: FSharp.Compiler.TypedTree.ValRef + member addrof2_vref: TypedTree.ValRef - member addrof_vref: FSharp.Compiler.TypedTree.ValRef + member addrof_vref: TypedTree.ValRef - member and2_vref: FSharp.Compiler.TypedTree.ValRef + member and2_vref: TypedTree.ValRef - member and_vref: FSharp.Compiler.TypedTree.ValRef + member and_vref: TypedTree.ValRef member array2D_get_info: IntrinsicValRef - member array2D_get_vref: FSharp.Compiler.TypedTree.ValRef + member array2D_get_vref: TypedTree.ValRef member array2D_set_info: IntrinsicValRef member array3D_get_info: IntrinsicValRef - member array3D_get_vref: FSharp.Compiler.TypedTree.ValRef + member array3D_get_vref: TypedTree.ValRef member array3D_set_info: IntrinsicValRef member array4D_get_info: IntrinsicValRef - member array4D_get_vref: FSharp.Compiler.TypedTree.ValRef + member array4D_get_vref: TypedTree.ValRef member array4D_set_info: IntrinsicValRef member array_get_info: IntrinsicValRef - member array_get_vref: FSharp.Compiler.TypedTree.ValRef + member array_get_vref: TypedTree.ValRef member array_length_info: IntrinsicValRef member array_set_info: IntrinsicValRef - member array_tcr_nice: FSharp.Compiler.TypedTree.EntityRef + member array_tcr_nice: TypedTree.EntityRef member attrib_AbstractClassAttribute: BuiltinAttribInfo @@ -512,75 +512,75 @@ type internal TcGlobals = member attrib_IlExperimentalAttribute: BuiltinAttribInfo - member attribs_Unsupported: FSharp.Compiler.TypedTree.TyconRef list + member attribs_Unsupported: TypedTree.TyconRef list member bitwise_and_info: IntrinsicValRef - member bitwise_and_vref: FSharp.Compiler.TypedTree.ValRef + member bitwise_and_vref: TypedTree.ValRef member bitwise_or_info: IntrinsicValRef - member bitwise_or_vref: FSharp.Compiler.TypedTree.ValRef + member bitwise_or_vref: TypedTree.ValRef member bitwise_shift_left_info: IntrinsicValRef - member bitwise_shift_left_vref: FSharp.Compiler.TypedTree.ValRef + member bitwise_shift_left_vref: TypedTree.ValRef member bitwise_shift_right_info: IntrinsicValRef - member bitwise_shift_right_vref: FSharp.Compiler.TypedTree.ValRef + member bitwise_shift_right_vref: TypedTree.ValRef member bitwise_unary_not_info: IntrinsicValRef - member bitwise_unary_not_vref: FSharp.Compiler.TypedTree.ValRef + member bitwise_unary_not_vref: TypedTree.ValRef member bitwise_xor_info: IntrinsicValRef - member bitwise_xor_vref: FSharp.Compiler.TypedTree.ValRef + member bitwise_xor_vref: TypedTree.ValRef - member bool_tcr: FSharp.Compiler.TypedTree.EntityRef + member bool_tcr: TypedTree.EntityRef - member bool_ty: FSharp.Compiler.TypedTree.TType + member bool_ty: TypedTree.TType member box_info: IntrinsicValRef - member byref2_tcr: FSharp.Compiler.TypedTree.EntityRef + member byref2_tcr: TypedTree.EntityRef - member byref_tcr: FSharp.Compiler.TypedTree.EntityRef + member byref_tcr: TypedTree.EntityRef - member byrefkind_InOut_tcr: FSharp.Compiler.TypedTree.EntityRef + member byrefkind_InOut_tcr: TypedTree.EntityRef - member byrefkind_In_tcr: FSharp.Compiler.TypedTree.EntityRef + member byrefkind_In_tcr: TypedTree.EntityRef - member byrefkind_Out_tcr: FSharp.Compiler.TypedTree.EntityRef + member byrefkind_Out_tcr: TypedTree.EntityRef member byte_checked_info: IntrinsicValRef member byte_operator_info: IntrinsicValRef - member byte_tcr: FSharp.Compiler.TypedTree.EntityRef + member byte_tcr: TypedTree.EntityRef - member byte_ty: FSharp.Compiler.TypedTree.TType + member byte_ty: TypedTree.TType member call_with_witnesses_info: IntrinsicValRef member cast_quotation_info: IntrinsicValRef - member cgh__debugPoint_vref: FSharp.Compiler.TypedTree.ValRef + member cgh__debugPoint_vref: TypedTree.ValRef - member cgh__resumableEntry_vref: FSharp.Compiler.TypedTree.ValRef + member cgh__resumableEntry_vref: TypedTree.ValRef - member cgh__resumeAt_vref: FSharp.Compiler.TypedTree.ValRef + member cgh__resumeAt_vref: TypedTree.ValRef - member cgh__stateMachine_vref: FSharp.Compiler.TypedTree.ValRef + member cgh__stateMachine_vref: TypedTree.ValRef - member cgh__useResumableCode_vref: FSharp.Compiler.TypedTree.ValRef + member cgh__useResumableCode_vref: TypedTree.ValRef member char_operator_info: IntrinsicValRef - member char_tcr: FSharp.Compiler.TypedTree.EntityRef + member char_tcr: TypedTree.EntityRef - member char_ty: FSharp.Compiler.TypedTree.TType + member char_ty: TypedTree.TType member checkNullness: bool @@ -594,33 +594,33 @@ type internal TcGlobals = member checked_unary_minus_info: IntrinsicValRef - member choice2_tcr: FSharp.Compiler.TypedTree.EntityRef + member choice2_tcr: TypedTree.EntityRef - member choice3_tcr: FSharp.Compiler.TypedTree.EntityRef + member choice3_tcr: TypedTree.EntityRef - member choice4_tcr: FSharp.Compiler.TypedTree.EntityRef + member choice4_tcr: TypedTree.EntityRef - member choice5_tcr: FSharp.Compiler.TypedTree.EntityRef + member choice5_tcr: TypedTree.EntityRef - member choice6_tcr: FSharp.Compiler.TypedTree.EntityRef + member choice6_tcr: TypedTree.EntityRef - member choice7_tcr: FSharp.Compiler.TypedTree.EntityRef + member choice7_tcr: TypedTree.EntityRef - member compare_operator_vref: FSharp.Compiler.TypedTree.ValRef + member compare_operator_vref: TypedTree.ValRef member compilingFSharpCore: bool - member cons_ucref: FSharp.Compiler.TypedTree.UnionCaseRef + member cons_ucref: TypedTree.UnionCaseRef member create_event_info: IntrinsicValRef member create_instance_info: IntrinsicValRef - member date_tcr: FSharp.Compiler.TypedTree.EntityRef + member date_tcr: TypedTree.EntityRef - member decimal_tcr: FSharp.Compiler.TypedTree.EntityRef + member decimal_tcr: TypedTree.EntityRef - member decimal_ty: FSharp.Compiler.TypedTree.TType + member decimal_ty: TypedTree.TType member deserialize_quoted_FSharp_20_plus_info: IntrinsicValRef @@ -630,111 +630,111 @@ type internal TcGlobals = member emitDebugInfoInQuotations: bool - member enumOfValue_vref: FSharp.Compiler.TypedTree.ValRef + member enumOfValue_vref: TypedTree.ValRef member enum_DynamicallyAccessedMemberTypes: BuiltinAttribInfo member enum_operator_info: IntrinsicValRef - member enum_vref: FSharp.Compiler.TypedTree.ValRef + member enum_vref: TypedTree.ValRef - member equals_nullable_operator_vref: FSharp.Compiler.TypedTree.ValRef + member equals_nullable_operator_vref: TypedTree.ValRef member equals_operator_info: IntrinsicValRef - member equals_operator_vref: FSharp.Compiler.TypedTree.ValRef + member equals_operator_vref: TypedTree.ValRef - member exn_tcr: FSharp.Compiler.TypedTree.EntityRef + member exn_tcr: TypedTree.EntityRef - member exn_ty: FSharp.Compiler.TypedTree.TType + member exn_ty: TypedTree.TType - member exponentiation_vref: FSharp.Compiler.TypedTree.ValRef + member exponentiation_vref: TypedTree.ValRef - member expr_tcr: FSharp.Compiler.TypedTree.EntityRef + member expr_tcr: TypedTree.EntityRef member fail_init_info: IntrinsicValRef member fail_static_init_info: IntrinsicValRef - member failwith_vref: FSharp.Compiler.TypedTree.ValRef + member failwith_vref: TypedTree.ValRef - member failwithf_vref: FSharp.Compiler.TypedTree.ValRef + member failwithf_vref: TypedTree.ValRef - member fastFunc_tcr: FSharp.Compiler.TypedTree.EntityRef + member fastFunc_tcr: TypedTree.EntityRef member float32_operator_info: IntrinsicValRef - member float32_tcr: FSharp.Compiler.TypedTree.EntityRef + member float32_tcr: TypedTree.EntityRef - member float32_ty: FSharp.Compiler.TypedTree.TType + member float32_ty: TypedTree.TType member float_operator_info: IntrinsicValRef - member float_tcr: FSharp.Compiler.TypedTree.EntityRef + member float_tcr: TypedTree.EntityRef - member float_ty: FSharp.Compiler.TypedTree.TType + member float_ty: TypedTree.TType - member format4_tcr: FSharp.Compiler.TypedTree.EntityRef + member format4_tcr: TypedTree.EntityRef - member format_tcr: FSharp.Compiler.TypedTree.EntityRef + member format_tcr: TypedTree.EntityRef - member fslibCcu: FSharp.Compiler.TypedTree.CcuThunk + member fslibCcu: TypedTree.CcuThunk - member fslib_IDelegateEvent_tcr: FSharp.Compiler.TypedTree.EntityRef + member fslib_IDelegateEvent_tcr: TypedTree.EntityRef - member fslib_IEvent2_tcr: FSharp.Compiler.TypedTree.EntityRef + member fslib_IEvent2_tcr: TypedTree.EntityRef /// Indicates if we are generating witness arguments for SRTP constraints. Only done if the FSharp.Core /// supports witness arguments. member generateWitnesses: bool - member generic_compare_withc_tuple2_vref: FSharp.Compiler.TypedTree.ValRef + member generic_compare_withc_tuple2_vref: TypedTree.ValRef - member generic_compare_withc_tuple3_vref: FSharp.Compiler.TypedTree.ValRef + member generic_compare_withc_tuple3_vref: TypedTree.ValRef - member generic_compare_withc_tuple4_vref: FSharp.Compiler.TypedTree.ValRef + member generic_compare_withc_tuple4_vref: TypedTree.ValRef - member generic_compare_withc_tuple5_vref: FSharp.Compiler.TypedTree.ValRef + member generic_compare_withc_tuple5_vref: TypedTree.ValRef - member generic_comparison_inner_vref: FSharp.Compiler.TypedTree.ValRef + member generic_comparison_inner_vref: TypedTree.ValRef - member generic_comparison_withc_inner_vref: FSharp.Compiler.TypedTree.ValRef + member generic_comparison_withc_inner_vref: TypedTree.ValRef member generic_comparison_withc_outer_info: IntrinsicValRef - member generic_equality_er_inner_vref: FSharp.Compiler.TypedTree.ValRef + member generic_equality_er_inner_vref: TypedTree.ValRef member generic_equality_er_outer_info: IntrinsicValRef - member generic_equality_per_inner_vref: FSharp.Compiler.TypedTree.ValRef + member generic_equality_per_inner_vref: TypedTree.ValRef - member generic_equality_withc_inner_vref: FSharp.Compiler.TypedTree.ValRef + member generic_equality_withc_inner_vref: TypedTree.ValRef member generic_equality_withc_outer_info: IntrinsicValRef - member generic_equality_withc_outer_vref: FSharp.Compiler.TypedTree.ValRef + member generic_equality_withc_outer_vref: TypedTree.ValRef - member generic_equals_withc_tuple2_vref: FSharp.Compiler.TypedTree.ValRef + member generic_equals_withc_tuple2_vref: TypedTree.ValRef - member generic_equals_withc_tuple3_vref: FSharp.Compiler.TypedTree.ValRef + member generic_equals_withc_tuple3_vref: TypedTree.ValRef - member generic_equals_withc_tuple4_vref: FSharp.Compiler.TypedTree.ValRef + member generic_equals_withc_tuple4_vref: TypedTree.ValRef - member generic_equals_withc_tuple5_vref: FSharp.Compiler.TypedTree.ValRef + member generic_equals_withc_tuple5_vref: TypedTree.ValRef - member generic_hash_inner_vref: FSharp.Compiler.TypedTree.ValRef + member generic_hash_inner_vref: TypedTree.ValRef - member generic_hash_withc_inner_vref: FSharp.Compiler.TypedTree.ValRef + member generic_hash_withc_inner_vref: TypedTree.ValRef member generic_hash_withc_outer_info: IntrinsicValRef - member generic_hash_withc_tuple2_vref: FSharp.Compiler.TypedTree.ValRef + member generic_hash_withc_tuple2_vref: TypedTree.ValRef - member generic_hash_withc_tuple3_vref: FSharp.Compiler.TypedTree.ValRef + member generic_hash_withc_tuple3_vref: TypedTree.ValRef - member generic_hash_withc_tuple4_vref: FSharp.Compiler.TypedTree.ValRef + member generic_hash_withc_tuple4_vref: TypedTree.ValRef - member generic_hash_withc_tuple5_vref: FSharp.Compiler.TypedTree.ValRef + member generic_hash_withc_tuple5_vref: TypedTree.ValRef member get_generic_comparer_info: IntrinsicValRef @@ -746,19 +746,19 @@ type internal TcGlobals = member greater_than_operator: IntrinsicValRef - member greater_than_operator_vref: FSharp.Compiler.TypedTree.ValRef + member greater_than_operator_vref: TypedTree.ValRef member greater_than_or_equals_operator: IntrinsicValRef - member greater_than_or_equals_operator_vref: FSharp.Compiler.TypedTree.ValRef + member greater_than_or_equals_operator_vref: TypedTree.ValRef member hash_info: IntrinsicValRef - member il_arr_tcr_map: FSharp.Compiler.TypedTree.EntityRef array + member il_arr_tcr_map: TypedTree.EntityRef array member ilg: FSharp.Compiler.AbstractIL.IL.ILGlobals - member ilsigptr_tcr: FSharp.Compiler.TypedTree.EntityRef + member ilsigptr_tcr: TypedTree.EntityRef member iltyp_AsyncCallback: FSharp.Compiler.AbstractIL.IL.ILType @@ -786,39 +786,39 @@ type internal TcGlobals = member iltyp_ValueType: FSharp.Compiler.AbstractIL.IL.ILType - member inref_tcr: FSharp.Compiler.TypedTree.EntityRef + member inref_tcr: TypedTree.EntityRef member int16_checked_info: IntrinsicValRef member int16_operator_info: IntrinsicValRef - member int16_tcr: FSharp.Compiler.TypedTree.EntityRef + member int16_tcr: TypedTree.EntityRef - member int16_ty: FSharp.Compiler.TypedTree.TType + member int16_ty: TypedTree.TType member int32_checked_info: IntrinsicValRef member int32_operator_info: IntrinsicValRef - member int32_tcr: FSharp.Compiler.TypedTree.EntityRef + member int32_tcr: TypedTree.EntityRef - member int32_ty: FSharp.Compiler.TypedTree.TType + member int32_ty: TypedTree.TType member int64_checked_info: IntrinsicValRef member int64_operator_info: IntrinsicValRef - member int64_tcr: FSharp.Compiler.TypedTree.EntityRef + member int64_tcr: TypedTree.EntityRef - member int64_ty: FSharp.Compiler.TypedTree.TType + member int64_ty: TypedTree.TType member int_checked_info: IntrinsicValRef - member int_ty: FSharp.Compiler.TypedTree.TType + member int_ty: TypedTree.TType - member invalid_arg_vref: FSharp.Compiler.TypedTree.ValRef + member invalid_arg_vref: TypedTree.ValRef - member invalid_op_vref: FSharp.Compiler.TypedTree.ValRef + member invalid_op_vref: TypedTree.ValRef /// Indicates if we can use System.Array.Empty when emitting IL for empty array literals member isArrayEmptyAvailable: bool @@ -830,43 +830,43 @@ type internal TcGlobals = member isnull_info: IntrinsicValRef - member istype_fast_vref: FSharp.Compiler.TypedTree.ValRef + member istype_fast_vref: TypedTree.ValRef member istype_info: IntrinsicValRef - member istype_vref: FSharp.Compiler.TypedTree.ValRef + member istype_vref: TypedTree.ValRef - member knownFSharpCoreModules: System.Collections.Generic.IDictionary + member knownFSharpCoreModules: System.Collections.Generic.IDictionary member knownIntrinsics: System.Collections.Concurrent.ConcurrentDictionary< (string * string option * string * int), - FSharp.Compiler.TypedTree.ValRef + TypedTree.ValRef > - member knownWithNull: FSharp.Compiler.TypedTree.Nullness + member knownWithNull: TypedTree.Nullness - member knownWithoutNull: FSharp.Compiler.TypedTree.Nullness + member knownWithoutNull: TypedTree.Nullness member langFeatureNullness: bool - member langVersion: FSharp.Compiler.Features.LanguageVersion + member langVersion: Features.LanguageVersion member lazy_create_info: IntrinsicValRef member lazy_force_info: IntrinsicValRef - member lazy_tcr_canon: FSharp.Compiler.TypedTree.EntityRef + member lazy_tcr_canon: TypedTree.EntityRef - member lazy_tcr_nice: FSharp.Compiler.TypedTree.EntityRef + member lazy_tcr_nice: TypedTree.EntityRef member less_than_operator: IntrinsicValRef - member less_than_operator_vref: FSharp.Compiler.TypedTree.ValRef + member less_than_operator_vref: TypedTree.ValRef member less_than_or_equals_operator: IntrinsicValRef - member less_than_or_equals_operator_vref: FSharp.Compiler.TypedTree.ValRef + member less_than_or_equals_operator_vref: TypedTree.ValRef member lift_value_info: IntrinsicValRef @@ -874,525 +874,525 @@ type internal TcGlobals = member lift_value_with_name_info: IntrinsicValRef - member list_tcr_canon: FSharp.Compiler.TypedTree.EntityRef + member list_tcr_canon: TypedTree.EntityRef - member list_tcr_nice: FSharp.Compiler.TypedTree.EntityRef + member list_tcr_nice: TypedTree.EntityRef - member measureinverse_tcr: FSharp.Compiler.TypedTree.EntityRef + member measureinverse_tcr: TypedTree.EntityRef - member measureone_tcr: FSharp.Compiler.TypedTree.EntityRef + member measureone_tcr: TypedTree.EntityRef - member measureproduct_tcr: FSharp.Compiler.TypedTree.EntityRef + member measureproduct_tcr: TypedTree.EntityRef - member methodhandleof_vref: FSharp.Compiler.TypedTree.ValRef + member methodhandleof_vref: TypedTree.ValRef - member mk_Attribute_ty: FSharp.Compiler.TypedTree.TType + member mk_Attribute_ty: TypedTree.TType - member mk_IAsyncStateMachine_ty: FSharp.Compiler.TypedTree.TType + member mk_IAsyncStateMachine_ty: TypedTree.TType - member mk_IComparable_ty: FSharp.Compiler.TypedTree.TType + member mk_IComparable_ty: TypedTree.TType - member mk_IStructuralComparable_ty: FSharp.Compiler.TypedTree.TType + member mk_IStructuralComparable_ty: TypedTree.TType - member mk_IStructuralEquatable_ty: FSharp.Compiler.TypedTree.TType + member mk_IStructuralEquatable_ty: TypedTree.TType member mlCompatibility: bool - member nameof_vref: FSharp.Compiler.TypedTree.ValRef + member nameof_vref: TypedTree.ValRef member nativeint_checked_info: IntrinsicValRef member nativeint_operator_info: IntrinsicValRef - member nativeint_tcr: FSharp.Compiler.TypedTree.EntityRef + member nativeint_tcr: TypedTree.EntityRef - member nativeint_ty: FSharp.Compiler.TypedTree.TType + member nativeint_ty: TypedTree.TType - member nativeptr_tcr: FSharp.Compiler.TypedTree.EntityRef + member nativeptr_tcr: TypedTree.EntityRef - member nativeptr_tobyref_vref: FSharp.Compiler.TypedTree.ValRef + member nativeptr_tobyref_vref: TypedTree.ValRef member new_decimal_info: IntrinsicValRef member new_format_info: IntrinsicValRef - member new_format_vref: FSharp.Compiler.TypedTree.ValRef + member new_format_vref: TypedTree.ValRef member new_query_source_info: IntrinsicValRef - member nil_ucref: FSharp.Compiler.TypedTree.UnionCaseRef + member nil_ucref: TypedTree.UnionCaseRef member not_equals_operator: IntrinsicValRef - member not_equals_operator_vref: FSharp.Compiler.TypedTree.ValRef + member not_equals_operator_vref: TypedTree.ValRef - member null_arg_vref: FSharp.Compiler.TypedTree.ValRef + member null_arg_vref: TypedTree.ValRef - member nullable_equals_nullable_operator_vref: FSharp.Compiler.TypedTree.ValRef + member nullable_equals_nullable_operator_vref: TypedTree.ValRef - member nullable_equals_operator_vref: FSharp.Compiler.TypedTree.ValRef + member nullable_equals_operator_vref: TypedTree.ValRef - member obj_ty_ambivalent: FSharp.Compiler.TypedTree.TType + member obj_ty_ambivalent: TypedTree.TType - member obj_ty_noNulls: FSharp.Compiler.TypedTree.TType + member obj_ty_noNulls: TypedTree.TType - member obj_ty_withNulls: FSharp.Compiler.TypedTree.TType + member obj_ty_withNulls: TypedTree.TType member option_defaultValue_info: IntrinsicValRef - member option_tcr_canon: FSharp.Compiler.TypedTree.EntityRef + member option_tcr_canon: TypedTree.EntityRef - member option_tcr_nice: FSharp.Compiler.TypedTree.EntityRef + member option_tcr_nice: TypedTree.EntityRef member option_toNullable_info: IntrinsicValRef - member or2_vref: FSharp.Compiler.TypedTree.ValRef + member or2_vref: TypedTree.ValRef - member or_vref: FSharp.Compiler.TypedTree.ValRef + member or_vref: TypedTree.ValRef - member outref_tcr: FSharp.Compiler.TypedTree.EntityRef + member outref_tcr: TypedTree.EntityRef member pathMap: Internal.Utilities.PathMap - member pdecimal_tcr: FSharp.Compiler.TypedTree.EntityRef + member pdecimal_tcr: TypedTree.EntityRef - member pfloat32_tcr: FSharp.Compiler.TypedTree.EntityRef + member pfloat32_tcr: TypedTree.EntityRef - member pfloat_tcr: FSharp.Compiler.TypedTree.EntityRef + member pfloat_tcr: TypedTree.EntityRef - member pint16_tcr: FSharp.Compiler.TypedTree.EntityRef + member pint16_tcr: TypedTree.EntityRef - member pint64_tcr: FSharp.Compiler.TypedTree.EntityRef + member pint64_tcr: TypedTree.EntityRef - member pint8_tcr: FSharp.Compiler.TypedTree.EntityRef + member pint8_tcr: TypedTree.EntityRef - member pint_tcr: FSharp.Compiler.TypedTree.EntityRef + member pint_tcr: TypedTree.EntityRef - member piperight2_vref: FSharp.Compiler.TypedTree.ValRef + member piperight2_vref: TypedTree.ValRef - member piperight3_vref: FSharp.Compiler.TypedTree.ValRef + member piperight3_vref: TypedTree.ValRef - member piperight_vref: FSharp.Compiler.TypedTree.ValRef + member piperight_vref: TypedTree.ValRef - member pnativeint_tcr: FSharp.Compiler.TypedTree.EntityRef + member pnativeint_tcr: TypedTree.EntityRef - member puint16_tcr: FSharp.Compiler.TypedTree.EntityRef + member puint16_tcr: TypedTree.EntityRef - member puint64_tcr: FSharp.Compiler.TypedTree.EntityRef + member puint64_tcr: TypedTree.EntityRef - member puint8_tcr: FSharp.Compiler.TypedTree.EntityRef + member puint8_tcr: TypedTree.EntityRef - member puint_tcr: FSharp.Compiler.TypedTree.EntityRef + member puint_tcr: TypedTree.EntityRef - member punativeint_tcr: FSharp.Compiler.TypedTree.EntityRef + member punativeint_tcr: TypedTree.EntityRef - member query_builder_tcref: FSharp.Compiler.TypedTree.EntityRef + member query_builder_tcref: TypedTree.EntityRef - member query_for_vref: FSharp.Compiler.TypedTree.ValRef + member query_for_vref: TypedTree.ValRef - member query_run_enumerable_vref: FSharp.Compiler.TypedTree.ValRef + member query_run_enumerable_vref: TypedTree.ValRef - member query_run_value_vref: FSharp.Compiler.TypedTree.ValRef + member query_run_value_vref: TypedTree.ValRef - member query_select_vref: FSharp.Compiler.TypedTree.ValRef + member query_select_vref: TypedTree.ValRef member query_source_as_enum_info: IntrinsicValRef - member query_source_vref: FSharp.Compiler.TypedTree.ValRef + member query_source_vref: TypedTree.ValRef - member query_value_vref: FSharp.Compiler.TypedTree.ValRef + member query_value_vref: TypedTree.ValRef - member query_yield_from_vref: FSharp.Compiler.TypedTree.ValRef + member query_yield_from_vref: TypedTree.ValRef - member query_yield_vref: FSharp.Compiler.TypedTree.ValRef + member query_yield_vref: TypedTree.ValRef - member query_zero_vref: FSharp.Compiler.TypedTree.ValRef + member query_zero_vref: TypedTree.ValRef member quote_to_linq_lambda_info: IntrinsicValRef member raise_info: IntrinsicValRef - member raise_vref: FSharp.Compiler.TypedTree.ValRef + member raise_vref: TypedTree.ValRef - member range_byte_op_vref: FSharp.Compiler.TypedTree.ValRef + member range_byte_op_vref: TypedTree.ValRef - member range_char_op_vref: FSharp.Compiler.TypedTree.ValRef + member range_char_op_vref: TypedTree.ValRef - member range_generic_op_vref: FSharp.Compiler.TypedTree.ValRef + member range_generic_op_vref: TypedTree.ValRef - member range_int16_op_vref: FSharp.Compiler.TypedTree.ValRef + member range_int16_op_vref: TypedTree.ValRef - member range_int32_op_vref: FSharp.Compiler.TypedTree.ValRef + member range_int32_op_vref: TypedTree.ValRef - member range_int64_op_vref: FSharp.Compiler.TypedTree.ValRef + member range_int64_op_vref: TypedTree.ValRef - member range_nativeint_op_vref: FSharp.Compiler.TypedTree.ValRef + member range_nativeint_op_vref: TypedTree.ValRef - member range_op_vref: FSharp.Compiler.TypedTree.ValRef + member range_op_vref: TypedTree.ValRef - member range_sbyte_op_vref: FSharp.Compiler.TypedTree.ValRef + member range_sbyte_op_vref: TypedTree.ValRef - member range_step_generic_op_vref: FSharp.Compiler.TypedTree.ValRef + member range_step_generic_op_vref: TypedTree.ValRef - member range_step_op_vref: FSharp.Compiler.TypedTree.ValRef + member range_step_op_vref: TypedTree.ValRef - member range_uint16_op_vref: FSharp.Compiler.TypedTree.ValRef + member range_uint16_op_vref: TypedTree.ValRef - member range_uint32_op_vref: FSharp.Compiler.TypedTree.ValRef + member range_uint32_op_vref: TypedTree.ValRef - member range_uint64_op_vref: FSharp.Compiler.TypedTree.ValRef + member range_uint64_op_vref: TypedTree.ValRef - member range_unativeint_op_vref: FSharp.Compiler.TypedTree.ValRef + member range_unativeint_op_vref: TypedTree.ValRef - member raw_expr_tcr: FSharp.Compiler.TypedTree.EntityRef + member raw_expr_tcr: TypedTree.EntityRef member realsig: bool - member ref_tuple1_tcr: FSharp.Compiler.TypedTree.EntityRef + member ref_tuple1_tcr: TypedTree.EntityRef - member ref_tuple2_tcr: FSharp.Compiler.TypedTree.EntityRef + member ref_tuple2_tcr: TypedTree.EntityRef - member ref_tuple3_tcr: FSharp.Compiler.TypedTree.EntityRef + member ref_tuple3_tcr: TypedTree.EntityRef - member ref_tuple4_tcr: FSharp.Compiler.TypedTree.EntityRef + member ref_tuple4_tcr: TypedTree.EntityRef - member ref_tuple5_tcr: FSharp.Compiler.TypedTree.EntityRef + member ref_tuple5_tcr: TypedTree.EntityRef - member ref_tuple6_tcr: FSharp.Compiler.TypedTree.EntityRef + member ref_tuple6_tcr: TypedTree.EntityRef - member ref_tuple7_tcr: FSharp.Compiler.TypedTree.EntityRef + member ref_tuple7_tcr: TypedTree.EntityRef - member ref_tuple8_tcr: FSharp.Compiler.TypedTree.EntityRef + member ref_tuple8_tcr: TypedTree.EntityRef - member refcell_assign_vref: FSharp.Compiler.TypedTree.ValRef + member refcell_assign_vref: TypedTree.ValRef - member refcell_decr_vref: FSharp.Compiler.TypedTree.ValRef + member refcell_decr_vref: TypedTree.ValRef - member refcell_deref_vref: FSharp.Compiler.TypedTree.ValRef + member refcell_deref_vref: TypedTree.ValRef - member refcell_incr_vref: FSharp.Compiler.TypedTree.ValRef + member refcell_incr_vref: TypedTree.ValRef - member refcell_tcr_canon: FSharp.Compiler.TypedTree.EntityRef + member refcell_tcr_canon: TypedTree.EntityRef - member refcell_tcr_nice: FSharp.Compiler.TypedTree.EntityRef + member refcell_tcr_nice: TypedTree.EntityRef - member reference_equality_inner_vref: FSharp.Compiler.TypedTree.ValRef + member reference_equality_inner_vref: TypedTree.ValRef member reraise_info: IntrinsicValRef - member reraise_vref: FSharp.Compiler.TypedTree.ValRef + member reraise_vref: TypedTree.ValRef member sbyte_checked_info: IntrinsicValRef member sbyte_operator_info: IntrinsicValRef - member sbyte_tcr: FSharp.Compiler.TypedTree.EntityRef + member sbyte_tcr: TypedTree.EntityRef - member sbyte_ty: FSharp.Compiler.TypedTree.TType + member sbyte_ty: TypedTree.TType member seq_append_info: IntrinsicValRef - member seq_append_vref: FSharp.Compiler.TypedTree.ValRef + member seq_append_vref: TypedTree.ValRef member seq_collect_info: IntrinsicValRef - member seq_collect_vref: FSharp.Compiler.TypedTree.ValRef + member seq_collect_vref: TypedTree.ValRef member seq_delay_info: IntrinsicValRef - member seq_delay_vref: FSharp.Compiler.TypedTree.ValRef + member seq_delay_vref: TypedTree.ValRef member seq_empty_info: IntrinsicValRef - member seq_empty_vref: FSharp.Compiler.TypedTree.ValRef + member seq_empty_vref: TypedTree.ValRef member seq_finally_info: IntrinsicValRef - member seq_finally_vref: FSharp.Compiler.TypedTree.ValRef + member seq_finally_vref: TypedTree.ValRef member seq_generated_info: IntrinsicValRef - member seq_generated_vref: FSharp.Compiler.TypedTree.ValRef + member seq_generated_vref: TypedTree.ValRef member seq_info: IntrinsicValRef member seq_map_info: IntrinsicValRef - member seq_map_vref: FSharp.Compiler.TypedTree.ValRef + member seq_map_vref: TypedTree.ValRef member seq_of_functions_info: IntrinsicValRef member seq_singleton_info: IntrinsicValRef - member seq_singleton_vref: FSharp.Compiler.TypedTree.ValRef + member seq_singleton_vref: TypedTree.ValRef - member seq_tcr: FSharp.Compiler.TypedTree.EntityRef + member seq_tcr: TypedTree.EntityRef member seq_to_array_info: IntrinsicValRef - member seq_to_array_vref: FSharp.Compiler.TypedTree.ValRef + member seq_to_array_vref: TypedTree.ValRef member seq_to_list_info: IntrinsicValRef - member seq_to_list_vref: FSharp.Compiler.TypedTree.ValRef + member seq_to_list_vref: TypedTree.ValRef member seq_trywith_info: IntrinsicValRef member seq_using_info: IntrinsicValRef - member seq_using_vref: FSharp.Compiler.TypedTree.ValRef + member seq_using_vref: TypedTree.ValRef - member seq_vref: FSharp.Compiler.TypedTree.ValRef + member seq_vref: TypedTree.ValRef - member sizeof_vref: FSharp.Compiler.TypedTree.ValRef + member sizeof_vref: TypedTree.ValRef - member splice_expr_vref: FSharp.Compiler.TypedTree.ValRef + member splice_expr_vref: TypedTree.ValRef - member splice_raw_expr_vref: FSharp.Compiler.TypedTree.ValRef + member splice_raw_expr_vref: TypedTree.ValRef member sprintf_info: IntrinsicValRef - member sprintf_vref: FSharp.Compiler.TypedTree.ValRef + member sprintf_vref: TypedTree.ValRef - member string_ty: FSharp.Compiler.TypedTree.TType + member string_ty: TypedTree.TType - member string_ty_ambivalent: FSharp.Compiler.TypedTree.TType + member string_ty_ambivalent: TypedTree.TType - member struct_tuple1_tcr: FSharp.Compiler.TypedTree.EntityRef + member struct_tuple1_tcr: TypedTree.EntityRef - member struct_tuple2_tcr: FSharp.Compiler.TypedTree.EntityRef + member struct_tuple2_tcr: TypedTree.EntityRef - member struct_tuple3_tcr: FSharp.Compiler.TypedTree.EntityRef + member struct_tuple3_tcr: TypedTree.EntityRef - member struct_tuple4_tcr: FSharp.Compiler.TypedTree.EntityRef + member struct_tuple4_tcr: TypedTree.EntityRef - member struct_tuple5_tcr: FSharp.Compiler.TypedTree.EntityRef + member struct_tuple5_tcr: TypedTree.EntityRef - member struct_tuple6_tcr: FSharp.Compiler.TypedTree.EntityRef + member struct_tuple6_tcr: TypedTree.EntityRef - member struct_tuple7_tcr: FSharp.Compiler.TypedTree.EntityRef + member struct_tuple7_tcr: TypedTree.EntityRef - member struct_tuple8_tcr: FSharp.Compiler.TypedTree.EntityRef + member struct_tuple8_tcr: TypedTree.EntityRef - member suppressed_types: FSharp.Compiler.TypedTree.EntityRef list + member suppressed_types: TypedTree.EntityRef list - member system_ArgIterator_tcref: FSharp.Compiler.TypedTree.EntityRef option + member system_ArgIterator_tcref: TypedTree.EntityRef option - member system_Array_ty: FSharp.Compiler.TypedTree.TType + member system_Array_ty: TypedTree.TType - member system_Bool_tcref: FSharp.Compiler.TypedTree.EntityRef + member system_Bool_tcref: TypedTree.EntityRef - member system_Byte_tcref: FSharp.Compiler.TypedTree.EntityRef + member system_Byte_tcref: TypedTree.EntityRef - member system_Char_tcref: FSharp.Compiler.TypedTree.EntityRef + member system_Char_tcref: TypedTree.EntityRef - member system_Decimal_tcref: FSharp.Compiler.TypedTree.EntityRef + member system_Decimal_tcref: TypedTree.EntityRef - member system_Delegate_ty: FSharp.Compiler.TypedTree.TType + member system_Delegate_ty: TypedTree.TType - member system_Double_tcref: FSharp.Compiler.TypedTree.EntityRef + member system_Double_tcref: TypedTree.EntityRef - member system_Enum_ty: FSharp.Compiler.TypedTree.TType + member system_Enum_ty: TypedTree.TType - member system_ExceptionDispatchInfo_ty: FSharp.Compiler.TypedTree.TType option + member system_ExceptionDispatchInfo_ty: TypedTree.TType option - member system_FormattableStringFactory_ty: FSharp.Compiler.TypedTree.TType + member system_FormattableStringFactory_ty: TypedTree.TType - member system_FormattableString_tcref: FSharp.Compiler.TypedTree.EntityRef + member system_FormattableString_tcref: TypedTree.EntityRef - member system_FormattableString_ty: FSharp.Compiler.TypedTree.TType + member system_FormattableString_ty: TypedTree.TType - member system_GenericIComparable_tcref: FSharp.Compiler.TypedTree.EntityRef + member system_GenericIComparable_tcref: TypedTree.EntityRef - member system_GenericIEquatable_tcref: FSharp.Compiler.TypedTree.EntityRef + member system_GenericIEquatable_tcref: TypedTree.EntityRef - member system_IDisposable_ty: FSharp.Compiler.TypedTree.TType + member system_IDisposable_ty: TypedTree.TType - member system_IDisposableNull_ty: FSharp.Compiler.TypedTree.TType + member system_IDisposableNull_ty: TypedTree.TType - member system_IFormattable_tcref: FSharp.Compiler.TypedTree.EntityRef + member system_IFormattable_tcref: TypedTree.EntityRef - member system_IFormattable_ty: FSharp.Compiler.TypedTree.TType + member system_IFormattable_ty: TypedTree.TType - member system_Int16_tcref: FSharp.Compiler.TypedTree.EntityRef + member system_Int16_tcref: TypedTree.EntityRef - member system_Int32_tcref: FSharp.Compiler.TypedTree.EntityRef + member system_Int32_tcref: TypedTree.EntityRef - member system_Int64_tcref: FSharp.Compiler.TypedTree.EntityRef + member system_Int64_tcref: TypedTree.EntityRef - member system_IntPtr_tcref: FSharp.Compiler.TypedTree.EntityRef + member system_IntPtr_tcref: TypedTree.EntityRef - member system_LinqExpression_tcref: FSharp.Compiler.TypedTree.EntityRef + member system_LinqExpression_tcref: TypedTree.EntityRef - member system_MarshalByRefObject_tcref: FSharp.Compiler.TypedTree.EntityRef option + member system_MarshalByRefObject_tcref: TypedTree.EntityRef option - member system_MarshalByRefObject_ty: FSharp.Compiler.TypedTree.TType option + member system_MarshalByRefObject_ty: TypedTree.TType option - member system_MulticastDelegate_ty: FSharp.Compiler.TypedTree.TType + member system_MulticastDelegate_ty: TypedTree.TType - member system_Nullable_tcref: FSharp.Compiler.TypedTree.EntityRef + member system_Nullable_tcref: TypedTree.EntityRef - member system_Object_tcref: FSharp.Compiler.TypedTree.EntityRef + member system_Object_tcref: TypedTree.EntityRef - member system_Object_ty: FSharp.Compiler.TypedTree.TType + member system_Object_ty: TypedTree.TType - member system_RuntimeArgumentHandle_tcref: FSharp.Compiler.TypedTree.EntityRef option + member system_RuntimeArgumentHandle_tcref: TypedTree.EntityRef option - member system_RuntimeHelpers_ty: FSharp.Compiler.TypedTree.TType + member system_RuntimeHelpers_ty: TypedTree.TType - member system_RuntimeTypeHandle_ty: FSharp.Compiler.TypedTree.TType + member system_RuntimeTypeHandle_ty: TypedTree.TType - member system_SByte_tcref: FSharp.Compiler.TypedTree.EntityRef + member system_SByte_tcref: TypedTree.EntityRef - member system_Single_tcref: FSharp.Compiler.TypedTree.EntityRef + member system_Single_tcref: TypedTree.EntityRef - member system_String_tcref: FSharp.Compiler.TypedTree.EntityRef + member system_String_tcref: TypedTree.EntityRef - member system_Type_ty: FSharp.Compiler.TypedTree.TType + member system_Type_ty: TypedTree.TType - member system_TypedReference_tcref: FSharp.Compiler.TypedTree.EntityRef option + member system_TypedReference_tcref: TypedTree.EntityRef option - member system_UInt16_tcref: FSharp.Compiler.TypedTree.EntityRef + member system_UInt16_tcref: TypedTree.EntityRef - member system_UInt32_tcref: FSharp.Compiler.TypedTree.EntityRef + member system_UInt32_tcref: TypedTree.EntityRef - member system_UInt64_tcref: FSharp.Compiler.TypedTree.EntityRef + member system_UInt64_tcref: TypedTree.EntityRef - member system_UIntPtr_tcref: FSharp.Compiler.TypedTree.EntityRef + member system_UIntPtr_tcref: TypedTree.EntityRef - member system_Value_tcref: FSharp.Compiler.TypedTree.EntityRef + member system_Value_tcref: TypedTree.EntityRef - member system_Value_ty: FSharp.Compiler.TypedTree.TType + member system_Value_ty: TypedTree.TType - member system_Void_tcref: FSharp.Compiler.TypedTree.EntityRef + member system_Void_tcref: TypedTree.EntityRef - member tcref_IObservable: FSharp.Compiler.TypedTree.EntityRef + member tcref_IObservable: TypedTree.EntityRef - member tcref_IObserver: FSharp.Compiler.TypedTree.EntityRef + member tcref_IObserver: TypedTree.EntityRef - member tcref_LanguagePrimitives: FSharp.Compiler.TypedTree.EntityRef + member tcref_LanguagePrimitives: TypedTree.EntityRef - member tcref_System_Attribute: FSharp.Compiler.TypedTree.EntityRef + member tcref_System_Attribute: TypedTree.EntityRef - member tcref_System_Collections_Generic_Dictionary: FSharp.Compiler.TypedTree.EntityRef + member tcref_System_Collections_Generic_Dictionary: TypedTree.EntityRef - member tcref_System_Collections_Generic_ICollection: FSharp.Compiler.TypedTree.EntityRef + member tcref_System_Collections_Generic_ICollection: TypedTree.EntityRef - member tcref_System_Collections_Generic_IEnumerable: FSharp.Compiler.TypedTree.EntityRef + member tcref_System_Collections_Generic_IEnumerable: TypedTree.EntityRef - member tcref_System_Collections_Generic_IEnumerator: FSharp.Compiler.TypedTree.EntityRef + member tcref_System_Collections_Generic_IEnumerator: TypedTree.EntityRef - member tcref_System_Collections_Generic_IEqualityComparer: FSharp.Compiler.TypedTree.EntityRef + member tcref_System_Collections_Generic_IEqualityComparer: TypedTree.EntityRef - member tcref_System_Collections_Generic_IList: FSharp.Compiler.TypedTree.EntityRef + member tcref_System_Collections_Generic_IList: TypedTree.EntityRef - member tcref_System_Collections_Generic_IReadOnlyCollection: FSharp.Compiler.TypedTree.EntityRef + member tcref_System_Collections_Generic_IReadOnlyCollection: TypedTree.EntityRef - member tcref_System_Collections_Generic_IReadOnlyList: FSharp.Compiler.TypedTree.EntityRef + member tcref_System_Collections_Generic_IReadOnlyList: TypedTree.EntityRef - member tcref_System_Collections_IComparer: FSharp.Compiler.TypedTree.EntityRef + member tcref_System_Collections_IComparer: TypedTree.EntityRef - member tcref_System_Collections_IEnumerable: FSharp.Compiler.TypedTree.EntityRef + member tcref_System_Collections_IEnumerable: TypedTree.EntityRef - member tcref_System_Collections_IEqualityComparer: FSharp.Compiler.TypedTree.EntityRef + member tcref_System_Collections_IEqualityComparer: TypedTree.EntityRef - member tcref_System_IComparable: FSharp.Compiler.TypedTree.EntityRef + member tcref_System_IComparable: TypedTree.EntityRef - member tcref_System_IDisposable: FSharp.Compiler.TypedTree.EntityRef + member tcref_System_IDisposable: TypedTree.EntityRef - member tcref_System_IStructuralComparable: FSharp.Compiler.TypedTree.EntityRef + member tcref_System_IStructuralComparable: TypedTree.EntityRef - member tcref_System_IStructuralEquatable: FSharp.Compiler.TypedTree.EntityRef + member tcref_System_IStructuralEquatable: TypedTree.EntityRef member typedefof_info: IntrinsicValRef - member typedefof_vref: FSharp.Compiler.TypedTree.ValRef + member typedefof_vref: TypedTree.ValRef member typeof_info: IntrinsicValRef - member typeof_vref: FSharp.Compiler.TypedTree.ValRef + member typeof_vref: TypedTree.ValRef member uint16_checked_info: IntrinsicValRef member uint16_operator_info: IntrinsicValRef - member uint16_tcr: FSharp.Compiler.TypedTree.EntityRef + member uint16_tcr: TypedTree.EntityRef - member uint16_ty: FSharp.Compiler.TypedTree.TType + member uint16_ty: TypedTree.TType member uint32_checked_info: IntrinsicValRef member uint32_operator_info: IntrinsicValRef - member uint32_tcr: FSharp.Compiler.TypedTree.EntityRef + member uint32_tcr: TypedTree.EntityRef - member uint32_ty: FSharp.Compiler.TypedTree.TType + member uint32_ty: TypedTree.TType member uint64_checked_info: IntrinsicValRef member uint64_operator_info: IntrinsicValRef - member uint64_tcr: FSharp.Compiler.TypedTree.EntityRef + member uint64_tcr: TypedTree.EntityRef - member uint64_ty: FSharp.Compiler.TypedTree.TType + member uint64_ty: TypedTree.TType member unativeint_checked_info: IntrinsicValRef member unativeint_operator_info: IntrinsicValRef - member unativeint_ty: FSharp.Compiler.TypedTree.TType + member unativeint_ty: TypedTree.TType member unbox_fast_info: IntrinsicValRef - member unbox_fast_vref: FSharp.Compiler.TypedTree.ValRef + member unbox_fast_vref: TypedTree.ValRef member unbox_info: IntrinsicValRef - member unbox_vref: FSharp.Compiler.TypedTree.ValRef + member unbox_vref: TypedTree.ValRef member unchecked_addition_info: IntrinsicValRef - member unchecked_addition_vref: FSharp.Compiler.TypedTree.ValRef + member unchecked_addition_vref: TypedTree.ValRef member unchecked_defaultof_info: IntrinsicValRef - member unchecked_defaultof_vref: FSharp.Compiler.TypedTree.ValRef + member unchecked_defaultof_vref: TypedTree.ValRef member unchecked_division_info: IntrinsicValRef - member unchecked_division_vref: FSharp.Compiler.TypedTree.ValRef + member unchecked_division_vref: TypedTree.ValRef member unchecked_modulus_info: IntrinsicValRef - member unchecked_modulus_vref: FSharp.Compiler.TypedTree.ValRef + member unchecked_modulus_vref: TypedTree.ValRef member unchecked_multiply_info: IntrinsicValRef - member unchecked_multiply_vref: FSharp.Compiler.TypedTree.ValRef + member unchecked_multiply_vref: TypedTree.ValRef member unchecked_subtraction_info: IntrinsicValRef - member unchecked_subtraction_vref: FSharp.Compiler.TypedTree.ValRef + member unchecked_subtraction_vref: TypedTree.ValRef member unchecked_unary_minus_info: IntrinsicValRef - member unchecked_unary_minus_vref: FSharp.Compiler.TypedTree.ValRef + member unchecked_unary_minus_vref: TypedTree.ValRef - member unchecked_unary_not_vref: FSharp.Compiler.TypedTree.ValRef + member unchecked_unary_not_vref: TypedTree.ValRef - member unchecked_unary_plus_vref: FSharp.Compiler.TypedTree.ValRef + member unchecked_unary_plus_vref: TypedTree.ValRef - member unit_tcr_canon: FSharp.Compiler.TypedTree.EntityRef + member unit_tcr_canon: TypedTree.EntityRef - member unit_ty: FSharp.Compiler.TypedTree.TType + member unit_ty: TypedTree.TType member useReflectionFreeCodeGen: bool - member valueoption_tcr_canon: FSharp.Compiler.TypedTree.EntityRef + member valueoption_tcr_canon: TypedTree.EntityRef - member valueoption_tcr_nice: FSharp.Compiler.TypedTree.EntityRef + member valueoption_tcr_nice: TypedTree.EntityRef - member voidptr_tcr: FSharp.Compiler.TypedTree.EntityRef + member voidptr_tcr: TypedTree.EntityRef #if DEBUG // This global is only used during debug output diff --git a/src/Compiler/TypedTree/TypeProviders.fs b/src/Compiler/TypedTree/TypeProviders.fs index 425e31ea453..196e5d35adb 100644 --- a/src/Compiler/TypedTree/TypeProviders.fs +++ b/src/Compiler/TypedTree/TypeProviders.fs @@ -460,7 +460,7 @@ type ProvidedType (x: Type, ctxt: ProvidedTypeContext) = let argTypes = args |> Array.map (fun arg -> arg.RawSystemType) ProvidedType.CreateNoContext(x.MakeGenericType(argTypes)) - member _.AsProvidedVar name = ProvidedVar.CreateNonNull ctxt (Quotations.Var(name, x)) + member _.AsProvidedVar name = ProvidedVar.CreateNonNull ctxt (Var(name, x)) static member Create ctxt x : ProvidedType MaybeNull = match x with @@ -479,7 +479,7 @@ type ProvidedType (x: Type, ctxt: ProvidedTypeContext) = static member CreateNoContext (x:Type) = ProvidedType.CreateNonNull ProvidedTypeContext.Empty x - static member Void = ProvidedType.CreateNoContext typeof + static member Void = ProvidedType.CreateNoContext typeof member _.Handle = x @@ -1024,7 +1024,7 @@ type ProvidedVar (x: Var, ctxt) = /// Get the provided invoker expression for a particular use of a method. let GetInvokerExpression (provider: ITypeProvider, methodBase: ProvidedMethodBase, paramExprs: ProvidedVar[]) = - provider.GetInvokerExpression(methodBase.Handle, [| for p in paramExprs -> Quotations.Expr.Var p.Handle |]) |> ProvidedExpr.Create methodBase.Context + provider.GetInvokerExpression(methodBase.Handle, [| for p in paramExprs -> Expr.Var p.Handle |]) |> ProvidedExpr.Create methodBase.Context /// Compute the Name or FullName property of a provided type, reporting appropriate errors let CheckAndComputeProvidedNameProperty(m, st: Tainted, proj, propertyString) = diff --git a/src/Compiler/TypedTree/TypedTree.fs b/src/Compiler/TypedTree/TypedTree.fs index 3efd889f57b..5ff4f37f556 100644 --- a/src/Compiler/TypedTree/TypedTree.fs +++ b/src/Compiler/TypedTree/TypedTree.fs @@ -1538,7 +1538,7 @@ type TILObjectReprData = type TProvidedTypeInfo = { /// The parameters given to the provider that provided to this type. - ResolutionEnvironment: TypeProviders.ResolutionEnvironment + ResolutionEnvironment: ResolutionEnvironment /// The underlying System.Type (wrapped as a ProvidedType to make sure we don't call random things on /// System.Type, and wrapped as Tainted to make sure we track which provider this came from, for reporting @@ -2189,7 +2189,7 @@ let private (|Public|Internal|Private|) (TAccess p) = | _ when List.forall isInternalCompPath p -> Internal | _ -> Private -let getSyntaxAccessForCompPath (TAccess a) = match a with | CompPath(_, sa, _) :: _ -> sa | _ -> TypedTree.SyntaxAccess.Unknown +let getSyntaxAccessForCompPath (TAccess a) = match a with | CompPath(_, sa, _) :: _ -> sa | _ -> SyntaxAccess.Unknown let updateSyntaxAccessForCompPath access syntaxAccess = match access with @@ -2213,9 +2213,9 @@ type Accessibility = member x.AsILMemberAccess () = match getSyntaxAccessForCompPath x with - | TypedTree.SyntaxAccess.Public -> ILMemberAccess.Public - | TypedTree.SyntaxAccess.Internal -> ILMemberAccess.Assembly - | TypedTree.SyntaxAccess.Private -> ILMemberAccess.Private + | SyntaxAccess.Public -> ILMemberAccess.Public + | SyntaxAccess.Internal -> ILMemberAccess.Assembly + | SyntaxAccess.Private -> ILMemberAccess.Private | _ -> if x.IsPublic then ILMemberAccess.Public elif x.IsInternal then ILMemberAccess.Assembly @@ -5593,14 +5593,14 @@ type NamedDebugPointKey = override x.Equals(yobj: objnull) = match yobj with - | :? NamedDebugPointKey as y -> Range.equals x.Range y.Range && x.Name = y.Name + | :? NamedDebugPointKey as y -> equals x.Range y.Range && x.Name = y.Name | _ -> false interface IComparable with member x.CompareTo(yobj: obj) = match yobj with | :? NamedDebugPointKey as y -> - let c = Range.rangeOrder.Compare(x.Range, y.Range) + let c = rangeOrder.Compare(x.Range, y.Range) if c <> 0 then c else compare x.Name y.Name | _ -> -1 diff --git a/src/Compiler/TypedTree/TypedTree.fsi b/src/Compiler/TypedTree/TypedTree.fsi index d9216efbe5e..2ca4a7f5c68 100644 --- a/src/Compiler/TypedTree/TypedTree.fsi +++ b/src/Compiler/TypedTree/TypedTree.fsi @@ -208,7 +208,7 @@ type TyparFlags = rigidity: TyparRigidity * isFromError: bool * isCompGen: bool * - staticReq: Syntax.TyparStaticReq * + staticReq: TyparStaticReq * dynamicReq: TyparDynamicReq * equalityDependsOn: bool * comparisonDependsOn: bool * @@ -219,7 +219,7 @@ type TyparFlags = member WithCompatFlex: b: bool -> TyparFlags - member WithStaticReq: staticReq: Syntax.TyparStaticReq -> TyparFlags + member WithStaticReq: staticReq: TyparStaticReq -> TyparFlags /// Indicates that whether or not a generic type definition satisfies the comparison constraint is dependent on whether this type variable satisfies the comparison constraint. member ComparisonConditionalOn: bool @@ -253,7 +253,7 @@ type TyparFlags = member Rigidity: TyparRigidity /// Indicates if the type variable has a static "head type" requirement, i.e. ^a variables used in FSharp.Core type member constraints. - member StaticReq: Syntax.TyparStaticReq + member StaticReq: TyparStaticReq /// Encode entity flags into a bit field. We leave lots of space to allow for future expansion. [] @@ -349,7 +349,7 @@ type CompilationPath = member NestedCompPath: n: string -> moduleKind: ModuleOrNamespaceKind -> CompilationPath - member NestedPublicPath: id: Syntax.Ident -> PublicPath + member NestedPublicPath: id: Ident -> PublicPath member AccessPath: (string * ModuleOrNamespaceKind) list @@ -613,7 +613,7 @@ type Entity = member ILTyconRawMetadata: ILTypeDef /// The identifier at the point of declaration of the type definition. - member Id: Syntax.Ident + member Id: Ident /// Gets the immediate interface types of an F# type definition. Further interfaces may be supported through class type interface inheritance. member ImmediateInterfaceTypesOfFSharpTycon: TType list @@ -1154,7 +1154,7 @@ type UnionCase = mutable XmlDocSig: string /// Name/range of the case - Id: Syntax.Ident + Id: Ident /// If this field is populated, this is the implementation range for an item in a signature, otherwise it is /// the signature range for an item in an implementation @@ -1265,7 +1265,7 @@ type RecdField = mutable rfield_fattribs: Attribs /// Name/declaration-location of the field - rfield_id: Syntax.Ident + rfield_id: Ident rfield_name_generated: bool /// If this field is populated, this is the implementation range for an item in a signature, otherwise it is @@ -1297,7 +1297,7 @@ type RecdField = member FormalType: TType /// Name/declaration-location of the field - member Id: Syntax.Ident + member Id: Ident /// Indicates a compiler generated field, not visible to Intellisense or name resolution member IsCompilerGenerated: bool @@ -1436,7 +1436,7 @@ type ModuleOrNamespaceType = /// Get a table of types defined within this module, namespace or type. The /// table is indexed by both name type generic arity. This means that for generic /// types "List`1", the entry (List, 1) will be present. - member TypesByDemangledNameAndArity: LayeredMap + member TypesByDemangledNameAndArity: LayeredMap member TypesByMangledName: NameMap @@ -1446,7 +1446,7 @@ type ModuleOrNamespace = Entity /// Represents a type or exception definition in the typed AST type Tycon = Entity -val updateSyntaxAccessForCompPath: CompilationPath list -> TypedTree.SyntaxAccess -> CompilationPath list +val updateSyntaxAccessForCompPath: CompilationPath list -> SyntaxAccess -> CompilationPath list /// Represents the constraint on access for a construct [] @@ -1510,7 +1510,7 @@ type Typar = /// MUTABILITY: we set the names of generalized inference type parameters to make the look nice for IL code generation /// The identifier for the type parameter - mutable typar_id: Syntax.Ident + mutable typar_id: Ident /// The flag data for the type parameter mutable typar_flags: TyparFlags @@ -1563,7 +1563,7 @@ type Typar = member SetILName: il_name: string option -> unit /// Sets the identifier associated with a type variable - member SetIdent: id: Syntax.Ident -> unit + member SetIdent: id: Ident -> unit /// Set whether this type parameter is a compat-flex type parameter (i.e. where "expr :> tp" only emits an optional warning) member SetIsCompatFlex: b: bool -> unit @@ -1575,7 +1575,7 @@ type Typar = member SetRigidity: b: TyparRigidity -> unit /// Sets whether a type variable has a static requirement - member SetStaticReq: b: Syntax.TyparStaticReq -> unit + member SetStaticReq: b: TyparStaticReq -> unit override ToString: unit -> string @@ -1607,7 +1607,7 @@ type Typar = member ILName: string option /// The identifier for a type parameter definition - member Id: Syntax.Ident + member Id: Ident /// Indicates that whether this type parameter is a compat-flex type parameter (i.e. where "expr :> tp" only emits an optional warning) member IsCompatFlex: bool @@ -1647,7 +1647,7 @@ type Typar = member Stamp: Stamp /// Indicates if the type variable has a static "head type" requirement, i.e. ^a variables used in FSharp.Core type member constraints. - member StaticReq: Syntax.TyparStaticReq + member StaticReq: TyparStaticReq /// Get the XML documentation for the type parameter member XmlDoc: XmlDoc @@ -1735,7 +1735,7 @@ type TraitConstraintInfo = | TTrait of tys: TTypes * memberName: string * - memberFlags: Syntax.SynMemberFlags * + memberFlags: SynMemberFlags * objAndArgTys: TTypes * returnTyOpt: TType option * source: string option ref * @@ -1750,7 +1750,7 @@ type TraitConstraintInfo = member SupportTypes: TType list /// Get the member flags associated with the member constraint. - member MemberFlags: Syntax.SynMemberFlags + member MemberFlags: SynMemberFlags /// Get the member name associated with the member constraint. For preop member MemberLogicalName: string @@ -2083,7 +2083,7 @@ type Val = member HasDeclaringEntity: bool - member Id: Syntax.Ident + member Id: Ident /// Indicates if the value will ignore byref scoping rules member IgnoresByrefScope: bool @@ -2302,7 +2302,7 @@ type ValMemberInfo = /// Gets updated with 'true' if an abstract slot is implemented in the file being typechecked. Internal only. mutable IsImplemented: bool - MemberFlags: Syntax.SynMemberFlags + MemberFlags: SynMemberFlags } override ToString: unit -> string @@ -2538,7 +2538,7 @@ type EntityRef = member ILTyconRawMetadata: ILTypeDef /// The identifier at the point of declaration of the type definition. - member Id: Syntax.Ident + member Id: Ident /// Gets the immediate interface types of an F# type definition. Further interfaces may be supported through class type interface inheritance. member ImmediateInterfaceTypesOfFSharpTycon: TType list @@ -2827,7 +2827,7 @@ type ValRef = member HasDeclaringEntity: bool - member Id: Syntax.Ident + member Id: Ident /// Gets the dispatch slots implemented by this method, either 0 or 1 member ImplementedSlotSigs: SlotSig list @@ -3165,13 +3165,13 @@ type TTypes = TType list type AnonRecdTypeInfo = { mutable Assembly: CcuThunk mutable TupInfo: TupInfo - mutable SortedIds: Syntax.Ident[] + mutable SortedIds: Ident[] mutable Stamp: Stamp mutable SortedNames: string[] mutable IlTypeName: int64 } /// Create an AnonRecdTypeInfo from the basic data - static member Create: ccu: CcuThunk * tupInfo: TupInfo * ids: Syntax.Ident[] -> AnonRecdTypeInfo + static member Create: ccu: CcuThunk * tupInfo: TupInfo * ids: Ident[] -> AnonRecdTypeInfo static member NewUnlinked: unit -> AnonRecdTypeInfo @@ -3403,7 +3403,7 @@ type DecisionTreeTest = activePatRetKind: ActivePatternReturnKind * activePatIdentity: (ValRef * TypeInst) option * idx: int * - activePatternInfo: Syntax.PrettyNaming.ActivePatternInfo + activePatternInfo: PrettyNaming.ActivePatternInfo /// Used in error recovery | Error of range: range @@ -3435,12 +3435,12 @@ type Bindings = Binding list /// -- debugPoint: The debug point for the binding [] type Binding = - | TBind of var: Val * expr: Expr * debugPoint: Syntax.DebugPointAtBinding + | TBind of var: Val * expr: Expr * debugPoint: DebugPointAtBinding override ToString: unit -> string /// The information about whether to emit a sequence point for the binding - member DebugPoint: Syntax.DebugPointAtBinding + member DebugPoint: DebugPointAtBinding [] member DebugText: string @@ -3456,7 +3456,7 @@ type Binding = [] type ActivePatternElemRef = | APElemRef of - activePatternInfo: Syntax.PrettyNaming.ActivePatternInfo * + activePatternInfo: PrettyNaming.ActivePatternInfo * activePatternVal: ValRef * caseIndex: int * activePatRetKind: ActivePatternReturnKind @@ -3464,7 +3464,7 @@ type ActivePatternElemRef = override ToString: unit -> string /// Get the full information about the active pattern being referred to - member ActivePatternInfo: Syntax.PrettyNaming.ActivePatternInfo + member ActivePatternInfo: PrettyNaming.ActivePatternInfo /// Get a reference to the value for the active pattern being referred to member ActivePatternVal: ValRef @@ -3524,7 +3524,7 @@ type ArgReprInfo = mutable Attribs: Attribs /// The name for the argument at this position, if any - mutable Name: Syntax.Ident option + mutable Name: Ident option /// The range of the signature/implementation counterpart to this argument, if any mutable OtherRange: range option @@ -3539,7 +3539,7 @@ type ArgReprInfo = /// compiled as "real" IL type parameters, specifically for values with /// ValReprInfo. Any information here is propagated from signature through /// to the compiled code. -type TyparReprInfo = TyparReprInfo of Syntax.Ident * TyparKind +type TyparReprInfo = TyparReprInfo of Ident * TyparKind type Typars = Typar list @@ -3610,7 +3610,7 @@ type Expr = /// as the range for all the decision making type binding that happens during the decision tree /// execution. | Match of - debugPoint: Syntax.DebugPointAtBinding * + debugPoint: DebugPointAtBinding * inputRange: Text.range * decision: DecisionTree * targets: DecisionTreeTarget array * @@ -3667,7 +3667,7 @@ type Expr = | Link of Expr ref /// Indicates a debug point should be placed prior to the expression. - | DebugPoint of Syntax.DebugPointAtLeafExpr * Expr + | DebugPoint of DebugPointAtLeafExpr * Expr member ToDebugString: depth: int -> string @@ -3707,16 +3707,16 @@ type TOp = | UInt16s of uint16[] /// An operation representing a lambda-encoded while loop. The special while loop marker is used to mark compilations of 'foreach' expressions - | While of spWhile: Syntax.DebugPointAtWhile * marker: SpecialWhileLoopMarker + | While of spWhile: DebugPointAtWhile * marker: SpecialWhileLoopMarker /// An operation representing a lambda-encoded integer for-loop - | IntegerForLoop of spFor: Syntax.DebugPointAtFor * spTo: Syntax.DebugPointAtInOrTo * style: ForLoopStyle + | IntegerForLoop of spFor: DebugPointAtFor * spTo: DebugPointAtInOrTo * style: ForLoopStyle /// An operation representing a lambda-encoded try/with - | TryWith of spTry: Syntax.DebugPointAtTry * spWith: Syntax.DebugPointAtWith + | TryWith of spTry: DebugPointAtTry * spWith: DebugPointAtWith /// An operation representing a lambda-encoded try/finally - | TryFinally of spTry: Syntax.DebugPointAtTry * spFinally: Syntax.DebugPointAtFinally + | TryFinally of spTry: DebugPointAtTry * spFinally: DebugPointAtFinally /// Construct a record or object-model value. The ValRef is for self-referential class constructors, otherwise /// it indicates that we're in a constructor type the purpose of the expression is to @@ -3910,7 +3910,7 @@ type ObjExprMethod = [] member DebugText: string - member Id: Syntax.Ident + member Id: Ident /// Represents an abstract method slot, or delegate signature. /// @@ -3973,7 +3973,7 @@ type OpenDeclaration = { /// Syntax after 'open' as it's presented in source code. - Target: Syntax.SynOpenDeclTarget + Target: SynOpenDeclTarget /// Full range of the open declaration. Range: Text.range option @@ -3993,7 +3993,7 @@ type OpenDeclaration = /// Create a new instance of OpenDeclaration. static member Create: - target: Syntax.SynOpenDeclTarget * + target: SynOpenDeclTarget * modules: ModuleOrNamespaceRef list * types: TType list * appliedScope: Text.range * @@ -4077,7 +4077,7 @@ type CheckedImplFile = member IsScript: bool - member QualifiedNameOfFile: Syntax.QualifiedNameOfFile + member QualifiedNameOfFile: QualifiedNameOfFile member Signature: ModuleOrNamespaceType @@ -4394,7 +4394,7 @@ type Construct = static member KeyTyconByAccessNames: nm: string -> x: 'T -> KeyValuePair[] /// Key a Tycon or TyconRef by decoded name - static member KeyTyconByDecodedName: nm: string -> x: 'T -> KeyValuePair + static member KeyTyconByDecodedName: nm: string -> x: 'T -> KeyValuePair /// Create the field tables for a record or class type static member MakeRecdFieldsTable: ucs: RecdField list -> TyconRecdFields @@ -4424,7 +4424,7 @@ type Construct = /// Create a new TAST Entity node for an F# exception definition static member NewExn: cpath: CompilationPath option -> - id: Syntax.Ident -> + id: Ident -> access: Accessibility -> repr: ExceptionInfo -> attribs: Attribs -> @@ -4464,7 +4464,7 @@ type Construct = static member NewModuleOrNamespace: cpath: CompilationPath option -> access: Accessibility -> - id: Syntax.Ident -> + id: Ident -> xml: XmlDoc -> attribs: Attrib list -> mtype: MaybeLazy -> @@ -4500,7 +4500,7 @@ type Construct = static member NewRecdField: stat: bool -> konst: Const option -> - id: Syntax.Ident -> + id: Ident -> nameGenerated: bool -> ty: TType -> isMutable: bool -> @@ -4545,7 +4545,7 @@ type Construct = /// Create a new union case node static member NewUnionCase: - id: Syntax.Ident -> + id: Ident -> tys: RecdField list -> retTy: TType -> attribs: Attribs -> diff --git a/src/Compiler/TypedTree/TypedTreeBasics.fs b/src/Compiler/TypedTree/TypedTreeBasics.fs index 582d6767d7e..bf2e17c1c13 100644 --- a/src/Compiler/TypedTree/TypedTreeBasics.fs +++ b/src/Compiler/TypedTree/TypedTreeBasics.fs @@ -542,14 +542,14 @@ let compPathOfCcu (ccu: CcuThunk) = CompPath(ccu.ILScopeRef, SyntaxAccess.Unknow let taccessPublic = TAccess [] let compPathInternal = CompPath(ILScopeRef.Local, SyntaxAccess.Internal, []) let taccessInternal = TAccess [compPathInternal] -let taccessPrivate accessPath = let (CompPath(sc,_, paths)) = accessPath in TAccess [CompPath(sc, TypedTree.SyntaxAccess.Private, paths)] +let taccessPrivate accessPath = let (CompPath(sc,_, paths)) = accessPath in TAccess [CompPath(sc, SyntaxAccess.Private, paths)] let combineAccess access1 access2 = let (TAccess a1) = access1 let (TAccess a2) = access2 let combined = - if access1 = taccessPublic then updateSyntaxAccessForCompPath (a1@a2) TypedTree.SyntaxAccess.Public - elif access1 = taccessInternal then updateSyntaxAccessForCompPath (a1@a2) TypedTree.SyntaxAccess.Internal + if access1 = taccessPublic then updateSyntaxAccessForCompPath (a1@a2) SyntaxAccess.Public + elif access1 = taccessInternal then updateSyntaxAccessForCompPath (a1@a2) SyntaxAccess.Internal else (a1@a2) TAccess combined diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 6ad9c1fe727..8b6cb85d058 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -2711,7 +2711,7 @@ type TraitConstraintInfo with match traitInfo.MemberFlags.MemberKind with | SynMemberKind.PropertyGet | SynMemberKind.PropertySet -> - match PrettyNaming.TryChopPropertyName traitName0 with + match TryChopPropertyName traitName0 with | Some nm -> nm | None -> traitName0 | _ -> traitName0 @@ -3274,8 +3274,8 @@ type DisplayEnv = escapeKeywordNames = true includeStaticParametersInTypeNames = true } denv.SetOpenPaths - [ FSharpLib.RootPath - FSharpLib.CorePath + [ RootPath + CorePath CollectionsPath ControlPath (splitNamespace ExtraTopLevelOperatorsName) ] @@ -4404,12 +4404,12 @@ module DebugPrint = | Const.UIntPtr x -> (x |> string)+"un" | Const.Single d -> (let s = d.ToString("g12", System.Globalization.CultureInfo.InvariantCulture) - if String.forall (fun c -> System.Char.IsDigit c || c = '-') s + if String.forall (fun c -> Char.IsDigit c || c = '-') s then s + ".0" else s) + "f" | Const.Double d -> let s = d.ToString("g12", System.Globalization.CultureInfo.InvariantCulture) - if String.forall (fun c -> System.Char.IsDigit c || c = '-') s + if String.forall (fun c -> Char.IsDigit c || c = '-') s then s + ".0" else s | Const.Char c -> "'" + c.ToString() + "'" @@ -8045,7 +8045,7 @@ let tryMkCallCoreFunctionAsBuiltInWitness (g: TcGlobals) info tyargs argExprs m let TryEliminateDesugaredConstants g m c = match c with | Const.Decimal d -> - match System.Decimal.GetBits d with + match Decimal.GetBits d with | [| lo;med;hi; signExp |] -> let scale = (min (((signExp &&& 0xFF0000) >>> 16) &&& 0xFF) 28) |> byte let isNegative = (signExp &&& 0x80000000) <> 0 @@ -8236,10 +8236,10 @@ let mkReraise m returnTy = Expr.Op (TOp.Reraise, [returnTy], [], m) (* could sup // CompilationMappingAttribute, SourceConstructFlags //---------------------------------------------------------------------------- -let tnameCompilationSourceNameAttr = FSharpLib.Core + ".CompilationSourceNameAttribute" -let tnameCompilationArgumentCountsAttr = FSharpLib.Core + ".CompilationArgumentCountsAttribute" -let tnameCompilationMappingAttr = FSharpLib.Core + ".CompilationMappingAttribute" -let tnameSourceConstructFlags = FSharpLib.Core + ".SourceConstructFlags" +let tnameCompilationSourceNameAttr = Core + ".CompilationSourceNameAttribute" +let tnameCompilationArgumentCountsAttr = Core + ".CompilationArgumentCountsAttribute" +let tnameCompilationMappingAttr = Core + ".CompilationMappingAttribute" +let tnameSourceConstructFlags = Core + ".SourceConstructFlags" let tref_CompilationArgumentCountsAttr (g: TcGlobals) = mkILTyRef (g.fslibCcu.ILScopeRef, tnameCompilationArgumentCountsAttr) let tref_CompilationMappingAttr (g: TcGlobals) = mkILTyRef (g.fslibCcu.ILScopeRef, tnameCompilationMappingAttr) @@ -8300,7 +8300,7 @@ let TryDecodeTypeProviderAssemblyAttr (cattr: ILAttribute) : string MaybeNull op // FSharpInterfaceDataVersionAttribute //---------------------------------------------------------------------------- -let tname_SignatureDataVersionAttr = FSharpLib.Core + ".FSharpInterfaceDataVersionAttribute" +let tname_SignatureDataVersionAttr = Core + ".FSharpInterfaceDataVersionAttribute" let tref_SignatureDataVersionAttr fsharpCoreAssemblyScopeRef = mkILTyRef(fsharpCoreAssemblyScopeRef, tname_SignatureDataVersionAttr) @@ -8312,7 +8312,7 @@ let mkSignatureDataVersionAttr (g: TcGlobals) (version: ILVersionInfo) = ILAttribElem.Int32 (int32 version.Minor) ILAttribElem.Int32 (int32 version.Build)], []) -let tname_AutoOpenAttr = FSharpLib.Core + ".AutoOpenAttribute" +let tname_AutoOpenAttr = Core + ".AutoOpenAttribute" let IsSignatureDataVersionAttr cattr = isILAttribByName ([], tname_SignatureDataVersionAttr) cattr @@ -9047,7 +9047,7 @@ let buildAccessPath (cp: CompilationPath option) = match cp with | Some cp -> let ap = cp.AccessPath |> List.map fst |> List.toArray - System.String.Join(".", ap) + String.Join(".", ap) | None -> "Extension Type" let prependPath path name = if String.IsNullOrEmpty(path) then name else !!path + "." + name @@ -10121,7 +10121,7 @@ let EvalArithShiftOp (opInt8, opInt16, opInt32, opInt64, opUInt8, opUInt16, opUI | Expr.Const (Const.UInt32 x1, _, ty), Expr.Const (Const.Int32 shift, _, _) -> Expr.Const (Const.UInt32 (opUInt32 x1 shift), m, ty) | Expr.Const (Const.UInt64 x1, _, ty), Expr.Const (Const.Int32 shift, _, _) -> Expr.Const (Const.UInt64 (opUInt64 x1 shift), m, ty) | _ -> error (Error ( FSComp.SR.tastNotAConstantExpression(), m)) - with :? System.OverflowException -> error (Error ( FSComp.SR.tastConstantExpressionOverflow(), m)) + with :? OverflowException -> error (Error ( FSComp.SR.tastConstantExpressionOverflow(), m)) let EvalArithUnOp (opInt8, opInt16, opInt32, opInt64, opUInt8, opUInt16, opUInt32, opUInt64, opSingle, opDouble) (arg1: Expr) = // At compile-time we check arithmetic @@ -10139,7 +10139,7 @@ let EvalArithUnOp (opInt8, opInt16, opInt32, opInt64, opUInt8, opUInt16, opUInt3 | Expr.Const (Const.Single x1, _, ty) -> Expr.Const (Const.Single (opSingle x1), m, ty) | Expr.Const (Const.Double x1, _, ty) -> Expr.Const (Const.Double (opDouble x1), m, ty) | _ -> error (Error ( FSComp.SR.tastNotAConstantExpression(), m)) - with :? System.OverflowException -> error (Error ( FSComp.SR.tastConstantExpressionOverflow(), m)) + with :? OverflowException -> error (Error ( FSComp.SR.tastConstantExpressionOverflow(), m)) let EvalArithBinOp (opInt8, opInt16, opInt32, opInt64, opUInt8, opUInt16, opUInt32, opUInt64, opSingle, opDouble, opDecimal) (arg1: Expr) (arg2: Expr) = // At compile-time we check arithmetic @@ -10158,7 +10158,7 @@ let EvalArithBinOp (opInt8, opInt16, opInt32, opInt64, opUInt8, opUInt16, opUInt | Expr.Const (Const.Double x1, _, ty), Expr.Const (Const.Double x2, _, _) -> Expr.Const (Const.Double (opDouble x1 x2), m, ty) | Expr.Const (Const.Decimal x1, _, ty), Expr.Const (Const.Decimal x2, _, _) -> Expr.Const (Const.Decimal (opDecimal x1 x2), m, ty) | _ -> error (Error ( FSComp.SR.tastNotAConstantExpression(), m)) - with :? System.OverflowException -> error (Error ( FSComp.SR.tastConstantExpressionOverflow(), m)) + with :? OverflowException -> error (Error ( FSComp.SR.tastConstantExpressionOverflow(), m)) // See also PostTypeCheckSemanticChecks.CheckAttribArgExpr, which must match this precisely let rec EvalAttribArgExpr suppressLangFeatureCheck (g: TcGlobals) (x: Expr) = @@ -10635,10 +10635,10 @@ let (|IntegralRange|_|) g expr = | ValApp g g.range_uint16_op_vref ([], [start; step; finish], _) -> ValueSome (g.uint16_ty, (start, step, finish)) | ValApp g g.range_sbyte_op_vref ([], [start; step; finish], _) -> ValueSome (g.sbyte_ty, (start, step, finish)) | ValApp g g.range_byte_op_vref ([], [start; step; finish], _) -> ValueSome (g.byte_ty, (start, step, finish)) - | ValApp g g.range_char_op_vref ([], [start; finish], _) -> ValueSome (g.char_ty, (start, Expr.Const (Const.Char '\001', Text.Range.range0, g.char_ty), finish)) - | ValApp g g.range_op_vref (ty :: _, [start; finish], _) when isIntegerTy g ty || typeEquivAux EraseMeasures g ty g.char_ty -> ValueSome (ty, (start, mkTypedOne g Text.Range.range0 ty, finish)) + | ValApp g g.range_char_op_vref ([], [start; finish], _) -> ValueSome (g.char_ty, (start, Expr.Const (Const.Char '\001', range0, g.char_ty), finish)) + | ValApp g g.range_op_vref (ty :: _, [start; finish], _) when isIntegerTy g ty || typeEquivAux EraseMeasures g ty g.char_ty -> ValueSome (ty, (start, mkTypedOne g range0 ty, finish)) | ValApp g g.range_step_op_vref ([ty; ty2], [start; step; finish], _) when typeEquiv g ty ty2 && (isIntegerTy g ty || typeEquivAux EraseMeasures g ty g.char_ty) -> ValueSome (ty, (start, step, finish)) - | ValApp g g.range_generic_op_vref ([ty; ty2], [_one; _add; start; finish], _) when typeEquiv g ty ty2 && (isIntegerTy g ty || typeEquivAux EraseMeasures g ty g.char_ty) -> ValueSome (ty, (start, mkTypedOne g Text.Range.range0 ty, finish)) + | ValApp g g.range_generic_op_vref ([ty; ty2], [_one; _add; start; finish], _) when typeEquiv g ty ty2 && (isIntegerTy g ty || typeEquivAux EraseMeasures g ty g.char_ty) -> ValueSome (ty, (start, mkTypedOne g range0 ty, finish)) | ValApp g g.range_step_generic_op_vref ([ty; ty2], [_zero; _add; start; step; finish], _) when typeEquiv g ty ty2 && (isIntegerTy g ty || typeEquivAux EraseMeasures g ty g.char_ty) -> ValueSome (ty, (start, step, finish)) | _ -> ValueNone diff --git a/src/FSharp.Core/Linq.fs b/src/FSharp.Core/Linq.fs index 12ae077dfdb..505aabf2517 100644 --- a/src/FSharp.Core/Linq.fs +++ b/src/FSharp.Core/Linq.fs @@ -56,7 +56,7 @@ module LeafExpressionConverter = let StringConcat = methodhandleof (fun (x:objnull, y:objnull) -> String.Concat (x, y)) - |> System.Reflection.MethodInfo.GetMethodFromHandle + |> MethodInfo.GetMethodFromHandle :?> MethodInfo let SubstHelperRaw (q:Expr, x:Var array, y:objnull array) : Expr = @@ -232,7 +232,7 @@ module LeafExpressionConverter = return (source.IsArray || dest.IsArray) && StrictHasReferenceConversionTo(source, dest, true); *) hasReferenceConversionTo source dest - let SpecificCallToMethodInfo (minfo: System.Reflection.MethodInfo) = + let SpecificCallToMethodInfo (minfo: MethodInfo) = let isg1 = minfo.IsGenericMethod let gmd = if isg1 then minfo.GetGenericMethodDefinition() else null (fun tm -> @@ -247,7 +247,7 @@ module LeafExpressionConverter = | _ -> None) let (|SpecificCallToMethod|_|) (mhandle: RuntimeMethodHandle) = - let minfo = (System.Reflection.MethodInfo.GetMethodFromHandle mhandle) :?> MethodInfo + let minfo = (MethodInfo.GetMethodFromHandle mhandle) :?> MethodInfo SpecificCallToMethodInfo minfo let (|GenericArgs|) (minfo: MethodInfo) = minfo.GetGenericArguments() @@ -328,22 +328,22 @@ module LeafExpressionConverter = let (|CheckedMinusQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun (x, y) -> Checked.( - ) x y)) let (|CheckedMultiplyQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun (x, y) -> Checked.( * ) x y)) - let (|ConvCharQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Operators.char)) - let (|ConvDecimalQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Operators.decimal)) - let (|ConvFloatQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Operators.float)) - let (|ConvFloat32Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Operators.float32)) - let (|ConvSByteQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Operators.sbyte)) - - let (|ConvInt16Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Operators.int16)) - let (|ConvInt32Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Operators.int32)) - let (|ConvIntQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Operators.int)) - let (|ConvInt64Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Operators.int64)) - let (|ConvByteQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Operators.byte)) - let (|ConvUInt16Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Operators.uint16)) - let (|ConvUInt32Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Operators.uint32)) - let (|ConvUInt64Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Operators.uint64)) - let (|ConvIntPtrQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Operators.nativeint)) - let (|ConvUIntPtrQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Operators.unativeint)) + let (|ConvCharQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (char)) + let (|ConvDecimalQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (decimal)) + let (|ConvFloatQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (float)) + let (|ConvFloat32Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (float32)) + let (|ConvSByteQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (sbyte)) + + let (|ConvInt16Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (int16)) + let (|ConvInt32Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (int32)) + let (|ConvIntQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (int)) + let (|ConvInt64Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (int64)) + let (|ConvByteQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (byte)) + let (|ConvUInt16Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (uint16)) + let (|ConvUInt32Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (uint32)) + let (|ConvUInt64Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (uint64)) + let (|ConvIntPtrQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (nativeint)) + let (|ConvUIntPtrQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (unativeint)) let (|ConvInt8Q|_|) = SpecificCallToMethodInfo (typeof.Assembly.GetType("Microsoft.FSharp.Core.ExtraTopLevelOperators").GetMethod("ToSByte")) let (|ConvUInt8Q|_|) = SpecificCallToMethodInfo (typeof.Assembly.GetType("Microsoft.FSharp.Core.ExtraTopLevelOperators").GetMethod("ToByte")) @@ -394,19 +394,19 @@ module LeafExpressionConverter = //let (|ArrayTypeQ|_|) (ty:System.Type) = if ty.IsArray && ty.GetArrayRank() = 1 then Some (ty.GetElementType()) else None let substHelperMeth = methodhandleof (fun (x:Expr, y:Var array, z:objnull array) -> SubstHelper (x, y, z)) - |> System.Reflection.MethodInfo.GetMethodFromHandle + |> MethodInfo.GetMethodFromHandle :?> MethodInfo let substHelperRawMeth = methodhandleof (fun (x:Expr, y:Var array, z:objnull array) -> SubstHelperRaw (x, y, z)) - |> System.Reflection.MethodInfo.GetMethodFromHandle + |> MethodInfo.GetMethodFromHandle :?> MethodInfo - let (-->) ty1 ty2 = Reflection.FSharpType.MakeFunctionType(ty1, ty2) + let (-->) ty1 ty2 = FSharpType.MakeFunctionType(ty1, ty2) /// Extract member initialization expression stored in 'MemberInitializationHelper' (by QueryExtensions.fs) let rec (|Sequentials|) = function - | Patterns.Sequential(a, Sequentials (b, c)) -> (a :: b, c) + | Sequential(a, Sequentials (b, c)) -> (a :: b, c) | a -> [], a let (|MemberInitializationQ|_|) = function @@ -415,7 +415,7 @@ module LeafExpressionConverter = /// Extract construction of anonymous object noted by use of in 'NewAnonymousObjectHelper' (by QueryExtensions.fs) let (|NewAnonymousObjectQ|_|) = function - | NewAnonymousObjectHelperQ (None, _, [ Patterns.NewObject(ctor, args) ]) -> Some (ctor, args) + | NewAnonymousObjectHelperQ (None, _, [ NewObject(ctor, args) ]) -> Some (ctor, args) | _ -> None /// Extract nullable constructions @@ -431,23 +431,23 @@ module LeafExpressionConverter = match inp with // Generic cases - | Patterns.Var v -> + | Var v -> try Map.find v env.varEnv with | :? KeyNotFoundException -> invalidOp ("The variable '"+ v.Name + "' was not found in the translation context'") - | DerivedPatterns.AndAlso(x1, x2) -> + | AndAlso(x1, x2) -> Expression.AndAlso(ConvExprToLinqInContext env x1, ConvExprToLinqInContext env x2) |> asExpr - | DerivedPatterns.OrElse(x1, x2) -> + | OrElse(x1, x2) -> Expression.OrElse(ConvExprToLinqInContext env x1, ConvExprToLinqInContext env x2) |> asExpr - | Patterns.Value(x, ty) -> + | Value(x, ty) -> Expression.Constant(x, ty) |> asExpr | UnboxGeneric(_, GenericArgs [|toTy|], [x]) - | Patterns.Coerce(x, toTy) -> + | Coerce(x, toTy) -> let converted = ConvExprToLinqInContext env x // Most of conversion scenarios in C# are covered by Expression.Convert @@ -455,27 +455,27 @@ module LeafExpressionConverter = elif not (x.Type.IsValueType || toTy.IsValueType) && toTy.IsAssignableFrom x.Type then converted // converting reference type to supertype - do nothing else Expression.Convert(converted, toTy) |> asExpr // emit Expression.Convert - | Patterns.TypeTest(x, toTy) -> + | TypeTest(x, toTy) -> Expression.TypeIs(ConvExprToLinqInContext env x, toTy) |> asExpr | TypeTestGeneric(_, GenericArgs [|toTy|], [x]) -> Expression.TypeIs(ConvExprToLinqInContext env x, toTy) |> asExpr // Expr.*Get - | Patterns.FieldGet(objOpt, fieldInfo) -> + | FieldGet(objOpt, fieldInfo) -> Expression.Field(ConvObjArg env objOpt None, fieldInfo) |> asExpr - | Patterns.TupleGet(arg, n) -> + | TupleGet(arg, n) -> let argP = ConvExprToLinqInContext env arg let rec build ty argP n = - match Reflection.FSharpValue.PreComputeTuplePropertyInfo(ty, n) with + match FSharpValue.PreComputeTuplePropertyInfo(ty, n) with | propInfo, None -> Expression.Property(argP, propInfo) |> asExpr | propInfo, Some (nestedTy, n2) -> build nestedTy (Expression.Property(argP, propInfo) |> asExpr) n2 build arg.Type argP n - | Patterns.PropertyGet(objOpt, propInfo, args) -> + | PropertyGet(objOpt, propInfo, args) -> let coerceTo = if objOpt.IsSome && FSharpType.IsUnion propInfo.DeclaringType && FSharpType.IsUnion propInfo.DeclaringType.BaseType then Some propInfo.DeclaringType @@ -489,7 +489,7 @@ module LeafExpressionConverter = Expression.Call(ConvObjArg env objOpt coerceTo, propInfo.GetGetMethod(true), argsP) |> asExpr // Expr.(Call, Application) - | Patterns.Call(objOpt, minfo, args) -> + | Call(objOpt, minfo, args) -> match inp with // Special cases for this translation @@ -499,7 +499,7 @@ module LeafExpressionConverter = let bindings = [| for p in propInfos -> match p with - | Patterns.PropertySet(_, pinfo, args, assign) -> + | PropertySet(_, pinfo, args, assign) -> if args <> [] then raise (NotSupportedException "Parameterized properties not supported in member initialization.") Expression.Bind(pinfo, ConvExprToLinqInContext env assign) :> MemberBinding | _ -> @@ -642,7 +642,7 @@ module LeafExpressionConverter = #if !NO_CURRIED_FUNCTION_OPTIMIZATIONS // f x1 x2 x3 x4 --> InvokeFast4 - | Patterns.Application(Patterns.Application(Patterns.Application(Patterns.Application(f, arg1), arg2), arg3), arg4) -> + | Application(Application(Application(Application(f, arg1), arg2), arg3), arg4) -> // TODO: amortize this computation based on f.Type let meth = let domainTy1, rangeTy = getFunctionType f.Type @@ -655,7 +655,7 @@ module LeafExpressionConverter = Expression.Call((null:Expression), meth, argsP) |> asExpr // f x1 x2 x3 --> InvokeFast3 - | Patterns.Application(Patterns.Application(Patterns.Application(f, arg1), arg2), arg3) -> + | Application(Application(Application(f, arg1), arg2), arg3) -> // TODO: amortize this computation based on f.Type let meth = let domainTy1, rangeTy = getFunctionType f.Type @@ -667,7 +667,7 @@ module LeafExpressionConverter = Expression.Call((null:Expression), meth, argsP) |> asExpr // f x1 x2 --> InvokeFast2 - | Patterns.Application(Patterns.Application(f, arg1), arg2) -> + | Application(Application(f, arg1), arg2) -> // TODO: amortize this computation based on f.Type let meth = let domainTy1, rangeTy = getFunctionType f.Type @@ -679,7 +679,7 @@ module LeafExpressionConverter = #endif // f x1 --> Invoke - | Patterns.Application(f, arg) -> + | Application(f, arg) -> let fP = ConvExprToLinqInContext env f let argP = ConvExprToLinqInContext env arg // TODO: amortize this computation based on f.Type @@ -687,24 +687,24 @@ module LeafExpressionConverter = Expression.Call(fP, meth, [| argP |]) |> asExpr // Expr.New* - | Patterns.NewRecord(recdTy, args) -> - let ctorInfo = Reflection.FSharpValue.PreComputeRecordConstructorInfo(recdTy, showAll) + | NewRecord(recdTy, args) -> + let ctorInfo = FSharpValue.PreComputeRecordConstructorInfo(recdTy, showAll) Expression.New(ctorInfo, ConvExprsToLinq env args) |> asExpr - | Patterns.NewArray(ty, args) -> + | NewArray(ty, args) -> Expression.NewArrayInit(ty, ConvExprsToLinq env args) |> asExpr - | Patterns.DefaultValue ty -> + | DefaultValue ty -> Expression.New ty |> asExpr - | Patterns.NewUnionCase(unionCaseInfo, args) -> - let methInfo = Reflection.FSharpValue.PreComputeUnionConstructorInfo(unionCaseInfo, showAll) + | NewUnionCase(unionCaseInfo, args) -> + let methInfo = FSharpValue.PreComputeUnionConstructorInfo(unionCaseInfo, showAll) let argsR = ConvExprsToLinq env args Expression.Call((null:Expression), methInfo, argsR) |> asExpr #if !NO_PATTERN_MATCHING_IN_INPUT_LANGUAGE - | Patterns.UnionCaseTest(e, unionCaseInfo) -> - let methInfo = Reflection.FSharpValue.PreComputeUnionTagMemberInfo(unionCaseInfo.DeclaringType, showAll) + | UnionCaseTest(e, unionCaseInfo) -> + let methInfo = FSharpValue.PreComputeUnionTagMemberInfo(unionCaseInfo.DeclaringType, showAll) let obj = ConvExprToLinqInContext env e let tagE = match methInfo with @@ -716,39 +716,39 @@ module LeafExpressionConverter = Expression.Equal(tagE, Expression.Constant(unionCaseInfo.Tag)) |> asExpr #endif - | (Patterns.NewObject(ctorInfo, args) as x) -> + | (NewObject(ctorInfo, args) as x) -> match x with // LINQ providers prefer C# "Nullable x" to be "Convert x", since that's what C# uses // to construct nullable values. | NullableConstruction arg -> Expression.Convert(ConvExprToLinqInContext env arg, x.Type) |> asExpr | _ -> Expression.New(ctorInfo, ConvExprsToLinq env args) |> asExpr - | Patterns.NewDelegate(delegateTy, vs, b) -> + | NewDelegate(delegateTy, vs, b) -> let vsP = List.map ConvVarToLinq vs let env = { varEnv = List.foldBack2 (fun (v:Var) vP -> Map.add v (vP |> asExpr)) vs vsP env.varEnv } let bodyP = ConvExprToLinqInContext env b Expression.Lambda(delegateTy, bodyP, vsP) |> asExpr - | Patterns.NewTuple args -> + | NewTuple args -> let tupTy = let argTypes = args |> List.map (fun arg -> arg.Type) |> Array.ofList if inp.Type.IsValueType then - Reflection.FSharpType.MakeStructTupleType(inp.Type.Assembly, argTypes) + FSharpType.MakeStructTupleType(inp.Type.Assembly, argTypes) else - Reflection.FSharpType.MakeTupleType(argTypes) + FSharpType.MakeTupleType(argTypes) let argsP = ConvExprsToLinq env args let rec build ty (argsP: Expression array) = - match Reflection.FSharpValue.PreComputeTupleConstructorInfo ty with + match FSharpValue.PreComputeTupleConstructorInfo ty with | ctorInfo, None -> Expression.New(ctorInfo, argsP) |> asExpr | ctorInfo, Some (nestedTy) -> let n = ctorInfo.GetParameters().Length - 1 Expression.New(ctorInfo, Array.append argsP.[0..n-1] [| build nestedTy argsP.[n..] |]) |> asExpr build tupTy argsP - | Patterns.IfThenElse(g, t, e) -> + | IfThenElse(g, t, e) -> Expression.Condition(ConvExprToLinqInContext env g, ConvExprToLinqInContext env t, ConvExprToLinqInContext env e) |> asExpr - | Patterns.QuoteTyped x -> + | QuoteTyped x -> let fvs = x.GetFreeVars() Expression.Call(substHelperMeth.MakeGenericMethod [| x.Type |], @@ -757,7 +757,7 @@ module LeafExpressionConverter = (Expression.NewArrayInit(typeof, [| for fv in fvs -> Expression.Convert(env.varEnv.[fv], typeof) |> asExpr |]) |> asExpr) |]) |> asExpr - | Patterns.QuoteRaw x -> + | QuoteRaw x -> let fvs = x.GetFreeVars() Expression.Call(substHelperRawMeth, @@ -766,7 +766,7 @@ module LeafExpressionConverter = (Expression.NewArrayInit(typeof, [| for fv in fvs -> Expression.Convert(env.varEnv.[fv], typeof) |> asExpr |]) |> asExpr) |]) |> asExpr - | Patterns.Let (v, e, b) -> + | Let (v, e, b) -> let vP = ConvVarToLinq v let envinner = { varEnv = Map.add v (vP |> asExpr) env.varEnv } let bodyP = ConvExprToLinqInContext envinner b @@ -775,12 +775,12 @@ module LeafExpressionConverter = let lam = Expression.Lambda(ty, bodyP, [| vP |]) |> asExpr Expression.Call(lam, ty.GetMethod("Invoke", instanceBindingFlags), [| eP |]) |> asExpr - | Patterns.Lambda(v, body) -> + | Lambda(v, body) -> let vP = ConvVarToLinq v let env = { varEnv = Map.add v (vP |> asExpr) env.varEnv } let bodyP = ConvExprToLinqInContext env body let lambdaTy, tyargs = - if bodyP.Type = typeof then + if bodyP.Type = typeof then let tyargs = [| vP.Type |] typedefof>, tyargs else @@ -801,7 +801,7 @@ module LeafExpressionConverter = if linqExpressionsCondition e.Type then exprErasedConstructor(e, null) else - let method = Reflection.MethodInfo.GetMethodFromHandle fallback :?> Reflection.MethodInfo + let method = MethodInfo.GetMethodFromHandle fallback :?> MethodInfo exprErasedConstructor(e, method.MakeGenericMethod [| getNonNullableType x.Type; getNonNullableType inp.Type |]) |> asExpr @@ -814,7 +814,7 @@ module LeafExpressionConverter = if e1.Type = e2.Type && isLinqExpressionsSimpleShift e1.Type e2.Type then exprErasedConstructor(e1, e2, null) else - let method = Reflection.MethodInfo.GetMethodFromHandle fallback :?> Reflection.MethodInfo + let method = MethodInfo.GetMethodFromHandle fallback :?> MethodInfo exprErasedConstructor(e1, e2, method.MakeGenericMethod [| getNonNullableType x1.Type; getNonNullableType x2.Type; getNonNullableType inp.Type |]) |> asExpr @@ -827,7 +827,7 @@ module LeafExpressionConverter = if e1.Type = e2.Type && linqExpressionsCondition e1.Type then exprErasedConstructor(e1, e2, null) else - let method = Reflection.MethodInfo.GetMethodFromHandle fallback :?> Reflection.MethodInfo + let method = MethodInfo.GetMethodFromHandle fallback :?> MethodInfo exprErasedConstructor(e1, e2, method.MakeGenericMethod [| getNonNullableType x1.Type; getNonNullableType x2.Type; getNonNullableType inp.Type |]) |> asExpr @@ -854,7 +854,7 @@ module LeafExpressionConverter = // The false for (liftToNull: bool) indicates whether equality operators return a Nullable like in VB.NET (null when either argument is null) instead of bool like in C# (nulls equate to nulls). F# follows C# here. exprErasedConstructor(e1, e2, false, null) else - let method = Reflection.MethodInfo.GetMethodFromHandle fallback :?> Reflection.MethodInfo + let method = MethodInfo.GetMethodFromHandle fallback :?> MethodInfo exprErasedConstructor(e1, e2, false, method.MakeGenericMethod [| getNonNullableType x1.Type; getNonNullableType x2.Type; getNonNullableType inp.Type |]) |> asExpr @@ -865,7 +865,7 @@ module LeafExpressionConverter = if isLinqExpressionsConvertible e.Type inp.Type then exprErasedConstructor(e, inp.Type, null) else - let method = Reflection.MethodInfo.GetMethodFromHandle (if isChecked then methodhandleof (LanguagePrimitives.CheckedExplicitDynamic) else methodhandleof (LanguagePrimitives.ExplicitDynamic)) :?> Reflection.MethodInfo + let method = MethodInfo.GetMethodFromHandle (if isChecked then methodhandleof (LanguagePrimitives.CheckedExplicitDynamic) else methodhandleof (LanguagePrimitives.ExplicitDynamic)) :?> MethodInfo exprErasedConstructor(e, inp.Type, method.MakeGenericMethod [| getNonNullableType x.Type; getNonNullableType inp.Type |]) |> asExpr @@ -888,14 +888,14 @@ module LeafExpressionConverter = let ConvExprToLinq (e: Expr) = ConvExprToLinqInContext { varEnv = Map.empty } e - let QuotationToExpression (e: Microsoft.FSharp.Quotations.Expr) = ConvExprToLinq e + let QuotationToExpression (e: Expr) = ConvExprToLinq e let QuotationToLambdaExpression (e: Microsoft.FSharp.Quotations.Expr<'T>) = (ConvExprToLinq e) :?> Expression<'T> // This contorted compilation is used because LINQ's "Compile" is only allowed on lambda expressions, and LINQ // provides no other way to evaluate the expression. // // REVIEW: It is possible it is just better to interpret the expression in many common cases, e.g. property-gets, values etc. - let EvaluateQuotation (e: Microsoft.FSharp.Quotations.Expr) : objnull = + let EvaluateQuotation (e: Expr) : objnull = #if FX_NO_QUOTATIONS_COMPILE raise (new NotSupportedException()) #else @@ -908,6 +908,6 @@ module LeafExpressionConverter = let d = linqExpr.Compile () try d.DynamicInvoke [| box () |] - with :? System.Reflection.TargetInvocationException as exn -> + with :? TargetInvocationException as exn -> raise exn.InnerException #endif \ No newline at end of file diff --git a/src/FSharp.Core/Linq.fsi b/src/FSharp.Core/Linq.fsi index f03cc7976d3..bd72874448c 100644 --- a/src/FSharp.Core/Linq.fsi +++ b/src/FSharp.Core/Linq.fsi @@ -88,4 +88,4 @@ module LeafExpressionConverter = val SubstHelperRaw: Expr * Var array * objnull array -> Expr val internal (|SpecificCallToMethod|_|): - System.RuntimeMethodHandle -> (Expr -> (Expr option * Reflection.MethodInfo * Expr list) option) + RuntimeMethodHandle -> (Expr -> (Expr option * Reflection.MethodInfo * Expr list) option) diff --git a/src/FSharp.Core/Nullable.fs b/src/FSharp.Core/Nullable.fs index 354ce7bca75..b2d7c5122fd 100644 --- a/src/FSharp.Core/Nullable.fs +++ b/src/FSharp.Core/Nullable.fs @@ -160,105 +160,105 @@ module Nullable = [] let inline uint8 (value: Nullable<_>) = if value.HasValue then - Nullable(Operators.byte value.Value) + Nullable(byte value.Value) else Nullable() [] let inline int8 (value: Nullable<_>) = if value.HasValue then - Nullable(Operators.sbyte value.Value) + Nullable(sbyte value.Value) else Nullable() [] let inline byte (value: Nullable<_>) = if value.HasValue then - Nullable(Operators.byte value.Value) + Nullable(byte value.Value) else Nullable() [] let inline sbyte (value: Nullable<_>) = if value.HasValue then - Nullable(Operators.sbyte value.Value) + Nullable(sbyte value.Value) else Nullable() [] let inline int16 (value: Nullable<_>) = if value.HasValue then - Nullable(Operators.int16 value.Value) + Nullable(int16 value.Value) else Nullable() [] let inline uint16 (value: Nullable<_>) = if value.HasValue then - Nullable(Operators.uint16 value.Value) + Nullable(uint16 value.Value) else Nullable() [] let inline int (value: Nullable<_>) = if value.HasValue then - Nullable(Operators.int value.Value) + Nullable(int value.Value) else Nullable() [] let inline uint (value: Nullable<_>) = if value.HasValue then - Nullable(Operators.uint value.Value) + Nullable(uint value.Value) else Nullable() [] let inline enum (value: Nullable) = if value.HasValue then - Nullable(Operators.enum value.Value) + Nullable(enum value.Value) else Nullable() [] let inline int32 (value: Nullable<_>) = if value.HasValue then - Nullable(Operators.int32 value.Value) + Nullable(int32 value.Value) else Nullable() [] let inline uint32 (value: Nullable<_>) = if value.HasValue then - Nullable(Operators.uint32 value.Value) + Nullable(uint32 value.Value) else Nullable() [] let inline int64 (value: Nullable<_>) = if value.HasValue then - Nullable(Operators.int64 value.Value) + Nullable(int64 value.Value) else Nullable() [] let inline uint64 (value: Nullable<_>) = if value.HasValue then - Nullable(Operators.uint64 value.Value) + Nullable(uint64 value.Value) else Nullable() [] let inline float32 (value: Nullable<_>) = if value.HasValue then - Nullable(Operators.float32 value.Value) + Nullable(float32 value.Value) else Nullable() [] let inline float (value: Nullable<_>) = if value.HasValue then - Nullable(Operators.float value.Value) + Nullable(float value.Value) else Nullable() @@ -279,27 +279,27 @@ module Nullable = [] let inline nativeint (value: Nullable<_>) = if value.HasValue then - Nullable(Operators.nativeint value.Value) + Nullable(nativeint value.Value) else Nullable() [] let inline unativeint (value: Nullable<_>) = if value.HasValue then - Nullable(Operators.unativeint value.Value) + Nullable(unativeint value.Value) else Nullable() [] let inline decimal (value: Nullable<_>) = if value.HasValue then - Nullable(Operators.decimal value.Value) + Nullable(decimal value.Value) else Nullable() [] let inline char (value: Nullable<_>) = if value.HasValue then - Nullable(Operators.char value.Value) + Nullable(char value.Value) else Nullable() diff --git a/src/FSharp.Core/Query.fs b/src/FSharp.Core/Query.fs index de1435df688..3211b3862bc 100644 --- a/src/FSharp.Core/Query.fs +++ b/src/FSharp.Core/Query.fs @@ -33,7 +33,7 @@ module Helpers = let checkThenBySource (source: seq<'T>) = match source with - | :? System.Linq.IOrderedEnumerable<'T> as source -> source + | :? IOrderedEnumerable<'T> as source -> source | _ -> invalidArg "source" (SR.GetString(SR.thenByError)) // used so we can define the implementation of QueryBuilder before the Query module (so in Query we can safely use methodhandleof) @@ -69,7 +69,7 @@ type QueryBuilder() = member _.Source (source: IQueryable<'T>) = QuerySource source - member _.Source (source: IEnumerable<'T>) : QuerySource<'T, System.Collections.IEnumerable> = + member _.Source (source: IEnumerable<'T>) : QuerySource<'T, IEnumerable> = QuerySource source member _.Contains (source: QuerySource<'T, 'Q>, key) = @@ -254,7 +254,7 @@ type QueryBuilder() = member _.RunQueryAsEnumerable (q: Quotations.Expr>) : IEnumerable<'T> = let queryAfterEliminatingNestedQueries = ForwardDeclarations.Query.EliminateNestedQueries q - let queryAfterCleanup = Microsoft.FSharp.Linq.RuntimeHelpers.Adapters.CleanupLeaf queryAfterEliminatingNestedQueries + let queryAfterCleanup = Adapters.CleanupLeaf queryAfterEliminatingNestedQueries (LeafExpressionConverter.EvaluateQuotation queryAfterCleanup :?> QuerySource<'T, IEnumerable>).Source member _.RunQueryAsQueryable (q: Quotations.Expr>) : IQueryable<'T> = @@ -370,22 +370,22 @@ module Query = let GetGenericMethodDefinition (methInfo:MethodInfo) = if methInfo.IsGenericMethod then methInfo.GetGenericMethodDefinition() else methInfo - let CallGenericStaticMethod (methHandle:System.RuntimeMethodHandle) = - let methInfo = methHandle |> System.Reflection.MethodInfo.GetMethodFromHandle :?> MethodInfo + let CallGenericStaticMethod (methHandle:RuntimeMethodHandle) = + let methInfo = methHandle |> MethodInfo.GetMethodFromHandle :?> MethodInfo fun (tyargs: Type list, args: objnull list) -> let methInfo = if methInfo.IsGenericMethod then methInfo.MakeGenericMethod(Array.ofList tyargs) else methInfo try methInfo.Invoke(null, Array.ofList args) - with :? System.Reflection.TargetInvocationException as exn -> + with :? TargetInvocationException as exn -> raise exn.InnerException - let CallGenericInstanceMethod (methHandle:System.RuntimeMethodHandle) = - let methInfo = methHandle |> System.Reflection.MethodInfo.GetMethodFromHandle :?> MethodInfo + let CallGenericInstanceMethod (methHandle:RuntimeMethodHandle) = + let methInfo = methHandle |> MethodInfo.GetMethodFromHandle :?> MethodInfo fun (objExpr:obj, tyargs: Type list, args: objnull list) -> let methInfo = if methInfo.IsGenericMethod then methInfo.MakeGenericMethod(Array.ofList tyargs) else methInfo try methInfo.Invoke(objExpr, Array.ofList args) - with :? System.Reflection.TargetInvocationException as exn -> + with :? TargetInvocationException as exn -> raise exn.InnerException let BindGenericStaticMethod (methInfo:MethodInfo) tyargs = @@ -394,17 +394,17 @@ module Query = else methInfo - let MakeGenericStaticMethod (methHandle:System.RuntimeMethodHandle) = - let methInfo = methHandle |> System.Reflection.MethodInfo.GetMethodFromHandle :?> MethodInfo + let MakeGenericStaticMethod (methHandle:RuntimeMethodHandle) = + let methInfo = methHandle |> MethodInfo.GetMethodFromHandle :?> MethodInfo (fun (tyargs: Type list, args: Expr list) -> Expr.Call (BindGenericStaticMethod methInfo tyargs, args)) - let MakeGenericInstanceMethod (methHandle:System.RuntimeMethodHandle) = - let methInfo = methHandle |> System.Reflection.MethodInfo.GetMethodFromHandle :?> MethodInfo + let MakeGenericInstanceMethod (methHandle:RuntimeMethodHandle) = + let methInfo = methHandle |> MethodInfo.GetMethodFromHandle :?> MethodInfo (fun (obj: Expr, tyargs: Type list, args: Expr list) -> Expr.Call (obj, BindGenericStaticMethod methInfo tyargs, args)) let ImplicitExpressionConversionHelperMethodInfo = - methodhandleof (LeafExpressionConverter.ImplicitExpressionConversionHelper) - |> System.Reflection.MethodInfo.GetMethodFromHandle + methodhandleof (ImplicitExpressionConversionHelper) + |> MethodInfo.GetMethodFromHandle :?> MethodInfo let MakeImplicitExpressionConversion (x: Expr) = Expr.Call (ImplicitExpressionConversionHelperMethodInfo.MakeGenericMethod [| x.Type |], [ x ]) @@ -433,24 +433,24 @@ module Query = let MakeIQueryableTy dty= IQueryableTypeDef.MakeGenericType [| dty|] - let IsQuerySourceTy (ty: System.Type) = ty.IsGenericType && ty.GetGenericTypeDefinition() = QuerySourceTypeDef + let IsQuerySourceTy (ty: Type) = ty.IsGenericType && ty.GetGenericTypeDefinition() = QuerySourceTypeDef - let IsIQueryableTy (ty: System.Type) = ty.IsGenericType && ty.GetGenericTypeDefinition() = IQueryableTypeDef + let IsIQueryableTy (ty: Type) = ty.IsGenericType && ty.GetGenericTypeDefinition() = IQueryableTypeDef - let IsIEnumerableTy (ty: System.Type) = ty.IsGenericType && ty.GetGenericTypeDefinition() = IEnumerableTypeDef + let IsIEnumerableTy (ty: Type) = ty.IsGenericType && ty.GetGenericTypeDefinition() = IEnumerableTypeDef // Check a tag type on QuerySource is IQueryable - let qTyIsIQueryable (ty : System.Type) = not (Type.op_Equality(ty, typeof)) + let qTyIsIQueryable (ty : Type) = not (Type.op_Equality(ty, typeof)) let FuncExprToDelegateExpr (srcTy, targetTy, v, body) = - Expr.NewDelegate (Linq.Expressions.Expression.GetFuncType [| srcTy; targetTy |], [v], body) + Expr.NewDelegate (Expression.GetFuncType [| srcTy; targetTy |], [v], body) /// Project F# function expressions to Linq LambdaExpression nodes let FuncExprToLinqFunc2Expression (srcTy, targetTy, v, body) = - FuncExprToDelegateExpr(srcTy, targetTy, v, body) |> LeafExpressionConverter.QuotationToExpression + FuncExprToDelegateExpr(srcTy, targetTy, v, body) |> QuotationToExpression let FuncExprToLinqFunc2 (srcTy, targetTy, v, body) = - FuncExprToDelegateExpr(srcTy, targetTy, v, body) |> LeafExpressionConverter.EvaluateQuotation + FuncExprToDelegateExpr(srcTy, targetTy, v, body) |> EvaluateQuotation let MakersCallers F = CallGenericStaticMethod F, MakeGenericStaticMethod F @@ -468,18 +468,18 @@ module Query = ME ([srcItemTy], [src; key]) let Call (isIQ, srcItemTy, src:objnull, key: Expr) = - let key = key |> LeafExpressionConverter.EvaluateQuotation + let key = key |> EvaluateQuotation let C = if isIQ then CQ else CE C ([srcItemTy], [src; box key]) Make, Call let MakeContains, CallContains = - let FQ = methodhandleof (fun (x, y) -> System.Linq.Queryable.Contains(x, y)) + let FQ = methodhandleof (fun (x, y) -> Queryable.Contains(x, y)) let FE = methodhandleof (fun (x, y) -> Enumerable.Contains(x, y)) MakeOrCallContainsOrElementAt FQ FE let MakeElementAt, CallElementAt = - let FQ = methodhandleof (fun (x, y) -> System.Linq.Queryable.ElementAt(x, y)) + let FQ = methodhandleof (fun (x, y) -> Queryable.ElementAt(x, y)) let FE = methodhandleof (fun (x, y) -> Enumerable.ElementAt(x, y)) MakeOrCallContainsOrElementAt FQ FE @@ -506,24 +506,24 @@ module Query = Make, Call let (MakeMinBy: bool * Expr * Var * Expr -> Expr), (CallMinBy : bool * Type * Type * objnull * Type * Var * Expr -> obj) = - let FQ = methodhandleof (fun (x, y: Expression>) -> System.Linq.Queryable.Min(x, y)) + let FQ = methodhandleof (fun (x, y: Expression>) -> Queryable.Min(x, y)) let FE = methodhandleof (fun (x, y: Func<_, 'Result>) -> Enumerable.Min(x, y)) MakeOrCallMinByOrMaxBy FQ FE let MakeMaxBy, CallMaxBy = - let FQ = methodhandleof (fun (x, y: Expression>) -> System.Linq.Queryable.Max(x, y)) + let FQ = methodhandleof (fun (x, y: Expression>) -> Queryable.Max(x, y)) let FE = methodhandleof (fun (x, y: Func<_, 'Result>) -> Enumerable.Max(x, y)) MakeOrCallMinByOrMaxBy FQ FE let MakeMinByNullable, CallMinByNullable = // Note there is no separate LINQ overload for Min on nullables - the one implementation just magically skips nullable elements - let FQ = methodhandleof (fun (x, y: Expression>) -> System.Linq.Queryable.Min(x, y)) + let FQ = methodhandleof (fun (x, y: Expression>) -> Queryable.Min(x, y)) let FE = methodhandleof (fun (x, y: Func<_, 'Result>) -> Enumerable.Min(x, y)) MakeOrCallMinByOrMaxBy FQ FE let MakeMaxByNullable, CallMaxByNullable = // Note there is no separate LINQ overload for Max on nullables - the one implementation just magically skips nullable elements - let FQ = methodhandleof (fun (x, y: Expression>) -> System.Linq.Queryable.Max(x, y)) + let FQ = methodhandleof (fun (x, y: Expression>) -> Queryable.Max(x, y)) let FE = methodhandleof (fun (x, y: Func<_, 'Result>) -> Enumerable.Max(x, y)) MakeOrCallMinByOrMaxBy FQ FE @@ -549,17 +549,17 @@ module Query = Make, Call let MakeAny, CallAny = - let FQ = methodhandleof (fun (x, y: Expression>) -> System.Linq.Queryable.Any(x, y)) + let FQ = methodhandleof (fun (x, y: Expression>) -> Queryable.Any(x, y)) let FE = methodhandleof (fun (x, y: Func<_, _>) -> Enumerable.Any(x, y)) MakeOrCallAnyOrAllOrFirstFind FQ FE let MakeAll, CallAll = - let FQ = methodhandleof (fun (x, y: Expression>) -> System.Linq.Queryable.All(x, y)) + let FQ = methodhandleof (fun (x, y: Expression>) -> Queryable.All(x, y)) let FE = methodhandleof (fun (x, y: Func<_, _>) -> Enumerable.All(x, y)) MakeOrCallAnyOrAllOrFirstFind FQ FE let MakeFirstFind, CallFirstFind = - let FQ = methodhandleof (fun (x, y: Expression>) -> System.Linq.Queryable.First(x, y)) + let FQ = methodhandleof (fun (x, y: Expression>) -> Queryable.First(x, y)) let FE = methodhandleof (fun (x, y: Func<_, _>) -> Enumerable.First(x, y)) MakeOrCallAnyOrAllOrFirstFind FQ FE @@ -646,20 +646,20 @@ module Query = let srcE = try ctor.Invoke [|src|] - with :? System.Reflection.TargetInvocationException as exn -> + with :? TargetInvocationException as exn -> raise exn.InnerException // The F# implementation needs an FSharpFunc as a parameter. - let selectorE = Expr.Lambda (v, res) |> LeafExpressionConverter.EvaluateQuotation + let selectorE = Expr.Lambda (v, res) |> EvaluateQuotation CE (qb, [srcItemTy; qTy; resTy], [srcE; selectorE]) Make, Call let MakeAverageBy, CallAverageBy = - let FQ_double = methodhandleof (fun (x, y: Expression>) -> System.Linq.Queryable.Average(x, y)) - let FQ_single = methodhandleof (fun (x, y: Expression>) -> System.Linq.Queryable.Average(x, y)) - let FQ_decimal = methodhandleof (fun (x, y: Expression>) -> System.Linq.Queryable.Average(x, y)) - let FQ_int32 = methodhandleof (fun (x, y: Expression>) -> System.Linq.Queryable.Average(x, y)) - let FQ_int64 = methodhandleof (fun (x, y: Expression>) -> System.Linq.Queryable.Average(x, y)) + let FQ_double = methodhandleof (fun (x, y: Expression>) -> Queryable.Average(x, y)) + let FQ_single = methodhandleof (fun (x, y: Expression>) -> Queryable.Average(x, y)) + let FQ_decimal = methodhandleof (fun (x, y: Expression>) -> Queryable.Average(x, y)) + let FQ_int32 = methodhandleof (fun (x, y: Expression>) -> Queryable.Average(x, y)) + let FQ_int64 = methodhandleof (fun (x, y: Expression>) -> Queryable.Average(x, y)) let FE_double = methodhandleof (fun (x, y: Func<_, double>) -> Enumerable.Average(x, y)) let FE_single = methodhandleof (fun (x, y: Func<_, single>) -> Enumerable.Average(x, y)) let FE_decimal = methodhandleof (fun (x, y: Func<_, decimal>) -> Enumerable.Average(x, y)) @@ -669,11 +669,11 @@ module Query = MakeOrCallAverageByOrSumByGeneric (false, FQ_double, FQ_single, FQ_decimal, FQ_int32, FQ_int64, FE_double, FE_single, FE_decimal, FE_int32, FE_int64, FE) let MakeAverageByNullable, CallAverageByNullable = - let FQ_double = methodhandleof (fun (x, y: Expression>>) -> System.Linq.Queryable.Average(x, y)) - let FQ_single = methodhandleof (fun (x, y: Expression>>) -> System.Linq.Queryable.Average(x, y)) - let FQ_decimal = methodhandleof (fun (x, y: Expression>>) -> System.Linq.Queryable.Average(x, y)) - let FQ_int32 = methodhandleof (fun (x, y: Expression>>) -> System.Linq.Queryable.Average(x, y)) - let FQ_int64 = methodhandleof (fun (x, y: Expression>>) -> System.Linq.Queryable.Average(x, y)) + let FQ_double = methodhandleof (fun (x, y: Expression>>) -> Queryable.Average(x, y)) + let FQ_single = methodhandleof (fun (x, y: Expression>>) -> Queryable.Average(x, y)) + let FQ_decimal = methodhandleof (fun (x, y: Expression>>) -> Queryable.Average(x, y)) + let FQ_int32 = methodhandleof (fun (x, y: Expression>>) -> Queryable.Average(x, y)) + let FQ_int64 = methodhandleof (fun (x, y: Expression>>) -> Queryable.Average(x, y)) let FE_double = methodhandleof (fun (x, y: Func<_, Nullable>) -> Enumerable.Average(x, y)) let FE_single = methodhandleof (fun (x, y: Func<_, Nullable>) -> Enumerable.Average(x, y)) let FE_decimal = methodhandleof (fun (x, y: Func<_, Nullable>) -> Enumerable.Average(x, y)) @@ -684,11 +684,11 @@ module Query = let MakeSumBy, CallSumBy = - let FQ_double = methodhandleof (fun (x, y: Expression>) -> System.Linq.Queryable.Sum(x, y)) - let FQ_single = methodhandleof (fun (x, y: Expression>) -> System.Linq.Queryable.Sum(x, y)) - let FQ_decimal = methodhandleof (fun (x, y: Expression>) -> System.Linq.Queryable.Sum(x, y)) - let FQ_int32 = methodhandleof (fun (x, y: Expression>) -> System.Linq.Queryable.Sum(x, y)) - let FQ_int64 = methodhandleof (fun (x, y: Expression>) -> System.Linq.Queryable.Sum(x, y)) + let FQ_double = methodhandleof (fun (x, y: Expression>) -> Queryable.Sum(x, y)) + let FQ_single = methodhandleof (fun (x, y: Expression>) -> Queryable.Sum(x, y)) + let FQ_decimal = methodhandleof (fun (x, y: Expression>) -> Queryable.Sum(x, y)) + let FQ_int32 = methodhandleof (fun (x, y: Expression>) -> Queryable.Sum(x, y)) + let FQ_int64 = methodhandleof (fun (x, y: Expression>) -> Queryable.Sum(x, y)) let FE_double = methodhandleof (fun (x, y: Func<_, double>) -> Enumerable.Sum(x, y)) let FE_single = methodhandleof (fun (x, y: Func<_, single>) -> Enumerable.Sum(x, y)) let FE_decimal = methodhandleof (fun (x, y: Func<_, decimal>) -> Enumerable.Sum(x, y)) @@ -698,11 +698,11 @@ module Query = MakeOrCallAverageByOrSumByGeneric (false, FQ_double, FQ_single, FQ_decimal, FQ_int32, FQ_int64, FE_double, FE_single, FE_decimal, FE_int32, FE_int64, FE) let MakeSumByNullable, CallSumByNullable = - let FQ_double = methodhandleof (fun (x, y: Expression>>) -> System.Linq.Queryable.Sum(x, y)) - let FQ_single = methodhandleof (fun (x, y: Expression>>) -> System.Linq.Queryable.Sum(x, y)) - let FQ_decimal = methodhandleof (fun (x, y: Expression>>) -> System.Linq.Queryable.Sum(x, y)) - let FQ_int32 = methodhandleof (fun (x, y: Expression>>) -> System.Linq.Queryable.Sum(x, y)) - let FQ_int64 = methodhandleof (fun (x, y: Expression>>) -> System.Linq.Queryable.Sum(x, y)) + let FQ_double = methodhandleof (fun (x, y: Expression>>) -> Queryable.Sum(x, y)) + let FQ_single = methodhandleof (fun (x, y: Expression>>) -> Queryable.Sum(x, y)) + let FQ_decimal = methodhandleof (fun (x, y: Expression>>) -> Queryable.Sum(x, y)) + let FQ_int32 = methodhandleof (fun (x, y: Expression>>) -> Queryable.Sum(x, y)) + let FQ_int64 = methodhandleof (fun (x, y: Expression>>) -> Queryable.Sum(x, y)) let FE_double = methodhandleof (fun (x, y: Func<_, Nullable>) -> Enumerable.Sum(x, y)) let FE_single = methodhandleof (fun (x, y: Func<_, Nullable>) -> Enumerable.Sum(x, y)) let FE_decimal = methodhandleof (fun (x, y: Func<_, Nullable>) -> Enumerable.Sum(x, y)) @@ -722,19 +722,19 @@ module Query = (if isIQ then CQ else CE) ([srcItemTy], [src]) Make, Call - let MakeFirst, CallFirst = MakeOrCallSimpleOp (methodhandleof (System.Linq.Queryable.First)) (methodhandleof (Enumerable.First)) + let MakeFirst, CallFirst = MakeOrCallSimpleOp (methodhandleof (Queryable.First)) (methodhandleof (Enumerable.First)) - let MakeFirstOrDefault, CallFirstOrDefault = MakeOrCallSimpleOp (methodhandleof (System.Linq.Queryable.FirstOrDefault)) (methodhandleof (Enumerable.FirstOrDefault)) + let MakeFirstOrDefault, CallFirstOrDefault = MakeOrCallSimpleOp (methodhandleof (Queryable.FirstOrDefault)) (methodhandleof (Enumerable.FirstOrDefault)) - let MakeLast, CallLast = MakeOrCallSimpleOp (methodhandleof (System.Linq.Queryable.Last)) (methodhandleof (Enumerable.Last)) + let MakeLast, CallLast = MakeOrCallSimpleOp (methodhandleof (Queryable.Last)) (methodhandleof (Enumerable.Last)) - let MakeLastOrDefault, CallLastOrDefault = MakeOrCallSimpleOp (methodhandleof (System.Linq.Queryable.LastOrDefault)) (methodhandleof (Enumerable.LastOrDefault)) + let MakeLastOrDefault, CallLastOrDefault = MakeOrCallSimpleOp (methodhandleof (Queryable.LastOrDefault)) (methodhandleof (Enumerable.LastOrDefault)) - let MakeSingle, CallSingle = MakeOrCallSimpleOp (methodhandleof (System.Linq.Queryable.Single)) (methodhandleof (Enumerable.Single)) + let MakeSingle, CallSingle = MakeOrCallSimpleOp (methodhandleof (Queryable.Single)) (methodhandleof (Enumerable.Single)) - let MakeSingleOrDefault, CallSingleOrDefault = MakeOrCallSimpleOp (methodhandleof (System.Linq.Queryable.SingleOrDefault)) (methodhandleof (Enumerable.SingleOrDefault)) + let MakeSingleOrDefault, CallSingleOrDefault = MakeOrCallSimpleOp (methodhandleof (Queryable.SingleOrDefault)) (methodhandleof (Enumerable.SingleOrDefault)) - let MakeCount, CallCount = MakeOrCallSimpleOp (methodhandleof (System.Linq.Queryable.Count)) (methodhandleof (Enumerable.Count)) + let MakeCount, CallCount = MakeOrCallSimpleOp (methodhandleof (Queryable.Count)) (methodhandleof (Enumerable.Count)) let MakeDefaultIfEmpty = MakeGenericStaticMethod (methodhandleof (Enumerable.DefaultIfEmpty)) @@ -746,13 +746,13 @@ module Query = | No = 1 let MakeSelect = - let FQ = MakeGenericStaticMethod (methodhandleof (fun (x, y: Expression>) -> System.Linq.Queryable.Select(x, y))) + let FQ = MakeGenericStaticMethod (methodhandleof (fun (x, y: Expression>) -> Queryable.Select(x, y))) let FE = MakeGenericStaticMethod (methodhandleof (fun (x, y: Func<_, _>) -> Enumerable.Select(x, y))) fun (canElim, isIQ, src: Expr, v: Var, f: Expr) -> // Eliminate degenerate 'Select(x => x)', except for the very outer-most cases match f with - | Patterns.Var v2 when v = v2 && canElim = CanEliminate.Yes -> src + | Var v2 when v = v2 && canElim = CanEliminate.Yes -> src | _ -> let srcItemTy = v.Type let targetTy = f.Type @@ -766,7 +766,7 @@ module Query = FE ([srcItemTy; targetTy], [src; selector]) let MakeAppend = - let FQ = MakeGenericStaticMethod (methodhandleof (fun (x, y) -> System.Linq.Queryable.Concat(x, y))) + let FQ = MakeGenericStaticMethod (methodhandleof (fun (x, y) -> Queryable.Concat(x, y))) let FE = MakeGenericStaticMethod (methodhandleof (fun (x, y) -> Enumerable.Concat(x, y))) fun (isIQ, srcItemTy, src1: Expr, src2: Expr) -> if isIQ then @@ -775,7 +775,7 @@ module Query = FE ([srcItemTy], [src1; src2]) let MakeAsQueryable = - let F = MakeGenericStaticMethod (methodhandleof (fun (x:seq<_>) -> System.Linq.Queryable.AsQueryable x)) + let F = MakeGenericStaticMethod (methodhandleof (fun (x:seq<_>) -> Queryable.AsQueryable x)) fun (ty, src) -> F ([ty], [src]) @@ -789,7 +789,7 @@ module Query = MakeAsQueryable (ty, MakeEnumerableEmpty ty) let MakeSelectMany = - let FQ = MakeGenericStaticMethod (methodhandleof (fun (x: IQueryable<_>, y: Expression>, z: Expression>) -> System.Linq.Queryable.SelectMany(x, y, z))) + let FQ = MakeGenericStaticMethod (methodhandleof (fun (x: IQueryable<_>, y: Expression>, z: Expression>) -> Queryable.SelectMany(x, y, z))) let FE = MakeGenericStaticMethod (methodhandleof (fun (x: IEnumerable<_>, y: Func<_, _>, z: Func<_, _, _>) -> Enumerable.SelectMany(x, y, z))) fun (isIQ, resTy: Type, src: Expr, srcItemVar: Var, interimSelectorBody: Expr, interimVar: Var, targetSelectorBody: Expr) -> let srcItemTy = srcItemVar.Type @@ -805,7 +805,7 @@ module Query = FE ([srcItemTy; interimTy; resTy], [src; interimSelector; targetSelector]) let MakeWhere = - let FQ = MakeGenericStaticMethod (methodhandleof (fun (x, y: Expression>) -> System.Linq.Queryable.Where(x, y))) + let FQ = MakeGenericStaticMethod (methodhandleof (fun (x, y: Expression>) -> Queryable.Where(x, y))) let FE = MakeGenericStaticMethod (methodhandleof (fun (x, y: Func<_, _>) -> Enumerable.Where(x, y))) fun (isIQ, src: Expr, v: Var, f) -> let selector = Expr.NewDelegate (MakeQueryFuncTy(v.Type, typeof), [v], f) @@ -828,22 +828,22 @@ module Query = FE ([srcItemTy; keyItemTy], [src; selector]) let MakeOrderBy = - let FQ = MakeGenericStaticMethod (methodhandleof (fun (x, y: Expression>) -> System.Linq.Queryable.OrderBy(x, y))) + let FQ = MakeGenericStaticMethod (methodhandleof (fun (x, y: Expression>) -> Queryable.OrderBy(x, y))) let FE = MakeGenericStaticMethod (methodhandleof (fun (x, y: Func<_, _>) -> Enumerable.OrderBy(x, y))) MakeOrderByOrThenBy FQ FE let MakeOrderByDescending = - let FQ = MakeGenericStaticMethod (methodhandleof (fun (x, y: Expression>) -> System.Linq.Queryable.OrderByDescending(x, y))) + let FQ = MakeGenericStaticMethod (methodhandleof (fun (x, y: Expression>) -> Queryable.OrderByDescending(x, y))) let FE = MakeGenericStaticMethod (methodhandleof (fun (x, y: Func<_, _>) -> Enumerable.OrderByDescending(x, y))) MakeOrderByOrThenBy FQ FE let MakeThenBy = - let FQ = MakeGenericStaticMethod (methodhandleof (fun (x, y: Expression>) -> System.Linq.Queryable.ThenBy(x, y))) + let FQ = MakeGenericStaticMethod (methodhandleof (fun (x, y: Expression>) -> Queryable.ThenBy(x, y))) let FE = MakeGenericStaticMethod (methodhandleof (fun (x, y: Func<_, _>) -> Enumerable.ThenBy(x, y))) MakeOrderByOrThenBy FQ FE let MakeThenByDescending = - let FQ = MakeGenericStaticMethod (methodhandleof (fun (x, y: Expression>) -> System.Linq.Queryable.ThenByDescending(x, y))) + let FQ = MakeGenericStaticMethod (methodhandleof (fun (x, y: Expression>) -> Queryable.ThenByDescending(x, y))) let FE = MakeGenericStaticMethod (methodhandleof (fun (x, y: Func<_, _>) -> Enumerable.ThenByDescending(x, y))) MakeOrderByOrThenBy FQ FE @@ -879,26 +879,26 @@ module Query = let MakeSkip = MakeSkipOrTake - (methodhandleof (fun (x, y) -> System.Linq.Queryable.Skip (x, y))) + (methodhandleof (fun (x, y) -> Queryable.Skip (x, y))) (methodhandleof (fun (x, y) -> Enumerable.Skip (x, y))) let MakeTake = MakeSkipOrTake - (methodhandleof (fun (x, y) -> System.Linq.Queryable.Take (x, y))) + (methodhandleof (fun (x, y) -> Queryable.Take (x, y))) (methodhandleof (fun (x, y) -> Enumerable.Take (x, y))) let MakeSkipWhile = GenMakeSkipWhileOrTakeWhile - (methodhandleof (fun (x, y: Expression>) -> System.Linq.Queryable.SkipWhile(x, y))) + (methodhandleof (fun (x, y: Expression>) -> Queryable.SkipWhile(x, y))) (methodhandleof (fun (x, y: Func<_, _>) -> Enumerable.SkipWhile(x, y))) let MakeTakeWhile = GenMakeSkipWhileOrTakeWhile - (methodhandleof (fun (x, y: Expression>) -> System.Linq.Queryable.TakeWhile(x, y))) + (methodhandleof (fun (x, y: Expression>) -> Queryable.TakeWhile(x, y))) (methodhandleof (fun (x, y: Func<_, _>) -> Enumerable.TakeWhile(x, y))) let MakeDistinct = - let FQ = MakeGenericStaticMethod (methodhandleof (System.Linq.Queryable.Distinct)) + let FQ = MakeGenericStaticMethod (methodhandleof (Queryable.Distinct)) let FE = MakeGenericStaticMethod (methodhandleof (Enumerable.Distinct)) fun (isIQ, srcItemTy, src: Expr) -> if isIQ then @@ -907,7 +907,7 @@ module Query = FE ([srcItemTy], [src]) let MakeGroupBy = - let FQ = MakeGenericStaticMethod (methodhandleof (fun (x, y: Expression>) -> System.Linq.Queryable.GroupBy(x, y))) + let FQ = MakeGenericStaticMethod (methodhandleof (fun (x, y: Expression>) -> Queryable.GroupBy(x, y))) let FE = MakeGenericStaticMethod (methodhandleof (fun (x, y: Func<_, _>) -> Enumerable.GroupBy(x, y))) fun (isIQ, src: Expr, v: Var, keySelector: Expr) -> let srcItemTy = v.Type @@ -921,7 +921,7 @@ module Query = FE ([srcItemTy; keyTy], [src; keySelector]) let MakeGroupValBy = - let FQ = MakeGenericStaticMethod (methodhandleof (fun (x, y: Expression>, z: Expression>) -> System.Linq.Queryable.GroupBy(x, y, z))) + let FQ = MakeGenericStaticMethod (methodhandleof (fun (x, y: Expression>, z: Expression>) -> Queryable.GroupBy(x, y, z))) let FE = MakeGenericStaticMethod (methodhandleof (fun (x, y: Func<_, _>, z: Func<_, _>) -> Enumerable.GroupBy(x, y, z))) fun (isIQ, srcItemTy, keyTy, elementTy, src: Expr, v1, keySelector, v2, elementSelector) -> let keySelector = Expr.NewDelegate (MakeQueryFuncTy(srcItemTy, keyTy), [v1], keySelector) @@ -935,7 +935,7 @@ module Query = FE ([srcItemTy; keyTy; elementTy], [src; keySelector; elementSelector]) let MakeJoin = - let FQ = MakeGenericStaticMethod (methodhandleof (fun (a1, a2, a3: Expression>, a4: Expression>, a5: Expression>) -> System.Linq.Queryable.Join(a1, a2, a3, a4, a5))) + let FQ = MakeGenericStaticMethod (methodhandleof (fun (a1, a2, a3: Expression>, a4: Expression>, a5: Expression>) -> Queryable.Join(a1, a2, a3, a4, a5))) let FE = MakeGenericStaticMethod (methodhandleof (fun (a1, a2, a3: Func<_, _>, a4: Func<_, _>, a5: Func<_, _, _>) -> Enumerable.Join(a1, a2, a3, a4, a5))) fun (isIQ, outerSourceTy, innerSourceTy, keyTy, resTy, outerSource: Expr, innerSource: Expr, outerKeyVar, outerKeySelector, innerKeyVar, innerKeySelector, outerResultKeyVar, innerResultKeyVar, elementSelector) -> let outerKeySelector = Expr.NewDelegate (MakeQueryFuncTy(outerSourceTy, keyTy), [outerKeyVar], outerKeySelector) @@ -951,7 +951,7 @@ module Query = FE ([outerSourceTy; innerSourceTy; keyTy; resTy], [outerSource; innerSource; outerKeySelector; innerKeySelector; elementSelector]) let MakeGroupJoin = - let FQ = MakeGenericStaticMethod (methodhandleof (fun (a1, a2, a3: Expression>, a4: Expression>, a5: Expression>) -> System.Linq.Queryable.GroupJoin(a1, a2, a3, a4, a5))) + let FQ = MakeGenericStaticMethod (methodhandleof (fun (a1, a2, a3: Expression>, a4: Expression>, a5: Expression>) -> Queryable.GroupJoin(a1, a2, a3, a4, a5))) let FE = MakeGenericStaticMethod (methodhandleof (fun (a1, a2, a3: Func<_, _>, a4: Func<_, _>, a5: Func<_, _, _>) -> Enumerable.GroupJoin(a1, a2, a3, a4, a5))) fun (isIQ, outerSourceTy, innerSourceTy, keyTy, resTy, outerSource: Expr, innerSource: Expr, outerKeyVar, outerKeySelector, innerKeyVar, innerKeySelector, outerResultKeyVar, innerResultGroupVar, elementSelector) -> let outerKeySelector = Expr.NewDelegate (MakeQueryFuncTy(outerSourceTy, keyTy), [outerKeyVar], outerKeySelector) @@ -1041,23 +1041,23 @@ module Query = | MacroReduction reduced -> Some (walk reduced) | _ -> None) - let (|CallQueryBuilderRunQueryable|_|) : Quotations.Expr -> _ = (|SpecificCallToMethod|_|) (methodhandleof (fun (b :QueryBuilder, v) -> b.Run v)) + let (|CallQueryBuilderRunQueryable|_|) : Expr -> _ = (|SpecificCallToMethod|_|) (methodhandleof (fun (b :QueryBuilder, v) -> b.Run v)) - let (|CallQueryBuilderRunValue|_|) : Quotations.Expr -> _ = (|SpecificCallToMethod|_|) (methodhandleof (fun (b : QueryBuilder, v: Expr<'a>) -> b.Run v) : 'a) + let (|CallQueryBuilderRunValue|_|) : Expr -> _ = (|SpecificCallToMethod|_|) (methodhandleof (fun (b : QueryBuilder, v: Expr<'a>) -> b.Run v) : 'a) - let (|CallQueryBuilderRunEnumerable|_|) : Quotations.Expr -> _ = (|SpecificCallToMethod|_|) (methodhandleof (fun (b : QueryBuilder, v: Expr> ) -> b.Run v)) + let (|CallQueryBuilderRunEnumerable|_|) : Expr -> _ = (|SpecificCallToMethod|_|) (methodhandleof (fun (b : QueryBuilder, v: Expr> ) -> b.Run v)) - let (|CallQueryBuilderFor|_|) : Quotations.Expr -> _ = (|SpecificCallToMethod|_|) (methodhandleof (fun (b:QueryBuilder, source: QuerySource, body) -> b.For(source, body))) + let (|CallQueryBuilderFor|_|) : Expr -> _ = (|SpecificCallToMethod|_|) (methodhandleof (fun (b:QueryBuilder, source: QuerySource, body) -> b.For(source, body))) - let (|CallQueryBuilderYield|_|) : Quotations.Expr -> _ = (|SpecificCall1|_|) (methodhandleof (fun (b:QueryBuilder, value) -> b.Yield value)) + let (|CallQueryBuilderYield|_|) : Expr -> _ = (|SpecificCall1|_|) (methodhandleof (fun (b:QueryBuilder, value) -> b.Yield value)) - let (|CallQueryBuilderYieldFrom|_|) : Quotations.Expr -> _ = (|SpecificCallToMethod|_|) (methodhandleof (fun (b:QueryBuilder, values) -> b.YieldFrom values)) + let (|CallQueryBuilderYieldFrom|_|) : Expr -> _ = (|SpecificCallToMethod|_|) (methodhandleof (fun (b:QueryBuilder, values) -> b.YieldFrom values)) - let (|CallQueryBuilderZero|_|) : Quotations.Expr -> _ = (|SpecificCallToMethod|_|) (methodhandleof (fun (b:QueryBuilder) -> b.Zero())) + let (|CallQueryBuilderZero|_|) : Expr -> _ = (|SpecificCallToMethod|_|) (methodhandleof (fun (b:QueryBuilder) -> b.Zero())) - let (|CallQueryBuilderSourceIQueryable|_|) : Quotations.Expr -> _ = (|SpecificCall1|_|) (methodhandleof (fun (b:QueryBuilder, value: IQueryable<_>) -> b.Source value)) + let (|CallQueryBuilderSourceIQueryable|_|) : Expr -> _ = (|SpecificCall1|_|) (methodhandleof (fun (b:QueryBuilder, value: IQueryable<_>) -> b.Source value)) - let (|CallQueryBuilderSourceIEnumerable|_|) : Quotations.Expr -> _ = (|SpecificCall1|_|) (methodhandleof (fun (b:QueryBuilder, value: IEnumerable<_>) -> b.Source value)) + let (|CallQueryBuilderSourceIEnumerable|_|) : Expr -> _ = (|SpecificCall1|_|) (methodhandleof (fun (b:QueryBuilder, value: IEnumerable<_>) -> b.Source value)) let (|CallSortBy|_|) = (|SpecificCall2|_|) (methodhandleof (fun (query:QueryBuilder, arg1, arg2) -> query.SortBy(arg1, arg2))) @@ -1141,7 +1141,7 @@ module Query = let (|ZeroOnElseBranch|_|) = function // This is the shape for 'match e with ... -> ... | _ -> ()' - | Patterns.Sequential(Patterns.Value(null, _), CallQueryBuilderZero _) + | Sequential(Value(null, _), CallQueryBuilderZero _) // This is the shape for from 'if/then' | CallQueryBuilderZero _ -> Some() | _ -> None @@ -1173,7 +1173,7 @@ module Query = | GroupingConv (immutKeyTy, immutElemTy, conv) -> - assert (mutExpr.Type.GetGenericTypeDefinition() = typedefof>) + assert (mutExpr.Type.GetGenericTypeDefinition() = typedefof>) let mutElemTy = mutExpr.Type.GetGenericArguments().[1] let immutIGroupingTy = typedefof>.MakeGenericType [| immutKeyTy; immutElemTy |] let immutGroupingTy = typedefof>.MakeGenericType [| immutKeyTy; immutElemTy |] @@ -1248,7 +1248,7 @@ module Query = // We eliminate the Select here to keep the information in 'mutSource' available, i.e. whether // the mutSource is a TransInnerResult.Source after elimination match mutSelectorBody with - | Patterns.Var v2 when mutSelectorVar = v2 && canElim = CanEliminate.Yes -> mutSource + | Var v2 when mutSelectorVar = v2 && canElim = CanEliminate.Yes -> mutSource | _ -> Select(canElim, isQTy, mutSource, mutSelectorVar, mutSelectorBody) @@ -1812,7 +1812,7 @@ module Query = let result = try - LeafExpressionConverter.EvaluateQuotation linqQueryAfterEliminatingNestedQueries + EvaluateQuotation linqQueryAfterEliminatingNestedQueries with e -> //#if DEBUG // debug() diff --git a/src/FSharp.Core/Query.fsi b/src/FSharp.Core/Query.fsi index 1791aba5847..c0774328cd6 100644 --- a/src/FSharp.Core/Query.fsi +++ b/src/FSharp.Core/Query.fsi @@ -178,7 +178,7 @@ namespace Microsoft.FSharp.Linq /// /// [] - member GroupBy: source:QuerySource<'T,'Q> * [] keySelector:('T -> 'Key) -> QuerySource,'Q> when 'Key: equality + member GroupBy: source:QuerySource<'T,'Q> * [] keySelector:('T -> 'Key) -> QuerySource,'Q> when 'Key: equality /// A query operator that sorts the elements selected so far in ascending order by the given sorting key. /// @@ -215,7 +215,7 @@ namespace Microsoft.FSharp.Linq /// /// [] - member GroupValBy<'T,'Key,'Value,'Q> : source:QuerySource<'T,'Q> * [] resultSelector:('T -> 'Value) * [] keySelector:('T -> 'Key) -> QuerySource,'Q> when 'Key: equality + member GroupValBy<'T,'Key,'Value,'Q> : source:QuerySource<'T,'Q> * [] resultSelector:('T -> 'Value) * [] keySelector:('T -> 'Key) -> QuerySource,'Q> when 'Key: equality /// A query operator that correlates two sets of selected values based on matching keys. /// Normal usage is 'join y in elements2 on (key1 = key2)'. diff --git a/src/FSharp.Core/QueryExtensions.fs b/src/FSharp.Core/QueryExtensions.fs index 378324ec55b..4b94e239fcb 100644 --- a/src/FSharp.Core/QueryExtensions.fs +++ b/src/FSharp.Core/QueryExtensions.fs @@ -193,7 +193,7 @@ module internal Adapters = match expr with | Patterns.PropertyGet(Some(Patterns.NewRecord(typ, els)), propInfo, []) -> let fields = - Microsoft.FSharp.Reflection.FSharpType.GetRecordFields( + FSharpType.GetRecordFields( typ, BindingFlags.Public ||| BindingFlags.NonPublic ) diff --git a/src/FSharp.Core/array.fs b/src/FSharp.Core/array.fs index 358836ddf1b..e0120183de8 100644 --- a/src/FSharp.Core/array.fs +++ b/src/FSharp.Core/array.fs @@ -67,7 +67,7 @@ module Array = let array: 'T array = Microsoft.FSharp.Primitives.Basics.Array.zeroCreateUnchecked count - for i = 0 to Operators.Checked.(-) array.Length 1 do // use checked arithmetic here to satisfy FxCop + for i = 0 to Checked.(-) array.Length 1 do // use checked arithmetic here to satisfy FxCop array.[i] <- value array @@ -891,7 +891,7 @@ module Array = if batchCount <> 0 then let batchSize = batchCount * 0x20 - System.Array.Copy(src, srcIdx - batchSize, dst, dstIdx, batchSize) + Array.Copy(src, srcIdx - batchSize, dst, dstIdx, batchSize) dstIdx <- dstIdx + batchSize batchCount <- 0 @@ -1027,7 +1027,7 @@ module Array = if batchCount <> 0 then let srcIdx = maskArray.Length * 0x20 let batchSize = batchCount * 0x20 - System.Array.Copy(src, srcIdx - batchSize, dst, dstIdx, batchSize) + Array.Copy(src, srcIdx - batchSize, dst, dstIdx, batchSize) dstIdx <- dstIdx + batchSize dstIdx @@ -2215,7 +2215,7 @@ module Array = [] let tryPick chooser (array: _ array) = checkNonNull "array" array - let allChosen = System.Collections.Concurrent.ConcurrentDictionary() + let allChosen = ConcurrentDictionary() let pResult = Parallel.For( @@ -2258,7 +2258,7 @@ module Array = isChosen.[i] <- true results.[i] <- v count + 1), - Action(fun x -> System.Threading.Interlocked.Add(&outputLength, x) |> ignore) + Action(fun x -> Interlocked.Add(&outputLength, x) |> ignore) ) |> ignore @@ -2402,7 +2402,7 @@ module Array = if array.Length = 0 then LanguagePrimitives.GenericZero else - array |> reduceBy projection Operators.Checked.(+) + array |> reduceBy projection Checked.(+) [] let inline sum (array: ^T array) : ^T = @@ -2421,7 +2421,7 @@ module Array = [] let inline averageBy ([] projection: 'T -> ^U) (array: 'T array) : ^U = - let sum = array |> reduceBy projection Operators.Checked.(+) + let sum = array |> reduceBy projection Checked.(+) LanguagePrimitives.DivideByInt sum (array.Length) [] @@ -2587,7 +2587,7 @@ module Array = trueCount + 1 else trueCount), - Action(fun x -> System.Threading.Interlocked.Add(&trueLength, x) |> ignore) + Action(fun x -> Interlocked.Add(&trueLength, x) |> ignore) ) |> ignore diff --git a/src/FSharp.Core/async.fs b/src/FSharp.Core/async.fs index 170b30cce0f..75cc3dedd4f 100644 --- a/src/FSharp.Core/async.fs +++ b/src/FSharp.Core/async.fs @@ -754,7 +754,7 @@ module AsyncPrimitives = /// - Run 'disposeFunction' with exception protection (see CreateTryFinallyAsync) let CreateUsingAsync (resource: 'T :> IDisposable | null) (computation: 'T -> Async<'a>) : Async<'a> = let disposeFunction () = - Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicFunctions.Dispose resource + LanguagePrimitives.IntrinsicFunctions.Dispose resource CreateTryFinallyAsync disposeFunction (CreateCallAsync computation resource) @@ -954,7 +954,7 @@ module AsyncPrimitives = member x.GetWaitHandle() = lock syncRoot (fun () -> if disposed then - raise (System.ObjectDisposedException("ResultCell")) + raise (ObjectDisposedException("ResultCell")) match resEvent with | null -> @@ -1059,7 +1059,7 @@ module AsyncPrimitives = | Some _ as r -> r | None -> // OK, let's really wait for the Set signal. This may block. - let timeout = defaultArg timeout Threading.Timeout.Infinite + let timeout = defaultArg timeout Timeout.Infinite let ok = resHandle.WaitOne(millisecondsTimeout = timeout, exitContext = true) if ok then @@ -1129,7 +1129,7 @@ module AsyncPrimitives = if innerCTS.IsSome then innerCTS.Value.Dispose() - raise (System.TimeoutException()) + raise (TimeoutException()) | Some res -> match innerCTS with | Some subSource -> subSource.Dispose() @@ -1304,7 +1304,7 @@ module AsyncPrimitives = | None -> () [] - type AsyncIAsyncResult<'T>(callback: System.AsyncCallback, state: objnull) = + type AsyncIAsyncResult<'T>(callback: AsyncCallback, state: objnull) = // This gets set to false if the result is not available by the // time the IAsyncResult is returned to the caller of Begin let mutable completedSynchronously = true @@ -1322,7 +1322,7 @@ module AsyncPrimitives = | null -> () | d -> // The IASyncResult becomes observable here - d.Invoke(s :> System.IAsyncResult) + d.Invoke(s :> IAsyncResult) member s.GetResult() = match result.TryWaitForResultSynchronously(-1) with @@ -1348,13 +1348,13 @@ module AsyncPrimitives = if not result.ResultAvailable then completedSynchronously <- false - interface System.IAsyncResult with + interface IAsyncResult with member _.IsCompleted = result.ResultAvailable member _.CompletedSynchronously = completedSynchronously member _.AsyncWaitHandle = result.GetWaitHandle() member _.AsyncState = state - interface System.IDisposable with + interface IDisposable with member x.Dispose() = x.Close() @@ -1379,7 +1379,7 @@ module AsyncPrimitives = match iar with | :? AsyncIAsyncResult<'T> as aiar -> if aiar.IsClosed then - raise (System.ObjectDisposedException("AsyncResult")) + raise (ObjectDisposedException("AsyncResult")) else let res = aiar.GetResult() aiar.Close() @@ -1511,24 +1511,24 @@ type Async = | Some token when not token.CanBeCanceled -> timeout, token | Some token -> None, token - AsyncPrimitives.RunSynchronously cancellationToken computation timeout + RunSynchronously cancellationToken computation timeout static member Start(computation, ?cancellationToken) = let cancellationToken = defaultArg cancellationToken defaultCancellationTokenSource.Token - AsyncPrimitives.Start cancellationToken computation + Start cancellationToken computation static member StartAsTask(computation, ?taskCreationOptions, ?cancellationToken) = let cancellationToken = defaultArg cancellationToken defaultCancellationTokenSource.Token - AsyncPrimitives.StartAsTask cancellationToken computation taskCreationOptions + StartAsTask cancellationToken computation taskCreationOptions static member StartChildAsTask(computation, ?taskCreationOptions) = async { let! cancellationToken = cancellationTokenAsync - return AsyncPrimitives.StartAsTask cancellationToken computation taskCreationOptions + return StartAsTask cancellationToken computation taskCreationOptions } static member Parallel(computations: seq>) = @@ -1538,7 +1538,7 @@ type Async = match maxDegreeOfParallelism with | Some x when x < 1 -> raise ( - System.ArgumentException( + ArgumentException( String.Format(SR.GetString(SR.maxDegreeOfParallelismNotPositive), x), "maxDegreeOfParallelism" ) @@ -1745,7 +1745,7 @@ type Async = let cancellationToken = defaultArg cancellationToken defaultCancellationTokenSource.Token - AsyncPrimitives.StartWithContinuations + StartWithContinuations cancellationToken computation continuation @@ -1784,7 +1784,7 @@ type Async = let cancellationToken = defaultArg cancellationToken defaultCancellationTokenSource.Token - AsyncPrimitives.StartWithContinuations cancellationToken computation id (fun edi -> edi.ThrowAny()) ignore + StartWithContinuations cancellationToken computation id (fun edi -> edi.ThrowAny()) ignore static member Sleep(millisecondsDueTime: int64) : Async = MakeAsyncWithCancelCheck(fun ctxt -> @@ -1847,7 +1847,7 @@ type Async = /// Wait for a wait handle. Both timeout and cancellation are supported static member AwaitWaitHandle(waitHandle: WaitHandle, ?millisecondsTimeout: int) = MakeAsyncWithCancelCheck(fun ctxt -> - let millisecondsTimeout = defaultArg millisecondsTimeout Threading.Timeout.Infinite + let millisecondsTimeout = defaultArg millisecondsTimeout Timeout.Infinite if millisecondsTimeout = 0 then let ok = waitHandle.WaitOne(0, exitContext = false) @@ -1940,7 +1940,7 @@ type Async = let res = resultCell.GrabResult() return res.Commit() else - return raise (System.TimeoutException()) + return raise (TimeoutException()) } | _ -> async { @@ -1963,7 +1963,7 @@ type Async = innerCTS.Cancel() // wait for computation to quiesce let! _ = Async.AwaitWaitHandle(resultCell.GetWaitHandle()) - return raise (System.TimeoutException()) + return raise (TimeoutException()) finally resultCell.Close() } @@ -2049,9 +2049,9 @@ type Async = static member AsBeginEnd<'Arg, 'T> (computation: ('Arg -> Async<'T>)) // The 'Begin' member - : ('Arg * System.AsyncCallback * objnull -> System.IAsyncResult) * - (System.IAsyncResult -> 'T) * - (System.IAsyncResult -> unit) + : ('Arg * AsyncCallback * objnull -> IAsyncResult) * + (IAsyncResult -> 'T) * + (IAsyncResult -> unit) = let beginAction = fun (a1, callback, state) -> AsBeginEndHelpers.beginAction ((computation a1), callback, state) @@ -2194,7 +2194,7 @@ type Async = |> Some let disposer = - { new System.IDisposable with + { new IDisposable with member _.Dispose() = // dispose CancellationTokenRegistration only if cancellation was not requested. // otherwise - do nothing, disposal will be performed by the handler itself diff --git a/src/FSharp.Core/async.fsi b/src/FSharp.Core/async.fsi index d4227d292f5..c55fc0537c9 100644 --- a/src/FSharp.Core/async.fsi +++ b/src/FSharp.Core/async.fsi @@ -251,7 +251,7 @@ namespace Microsoft.FSharp.Control /// This will print "2" 2 seconds from start, "3" 3 seconds from start, "5" 5 seconds from start, cease computation /// and then print "Computation Cancelled: 7", "Computation Cancelled: 11" and "Tasks Finished" in any order. /// - static member OnCancel : interruption: (unit -> unit) -> Async + static member OnCancel : interruption: (unit -> unit) -> Async /// Creates an asynchronous computation that returns the CancellationToken governing the execution /// of the computation. @@ -647,7 +647,7 @@ namespace Microsoft.FSharp.Control /// Threads and Contexts /// /// - static member SwitchToContext : syncContext:(System.Threading.SynchronizationContext | null) -> Async + static member SwitchToContext : syncContext:(SynchronizationContext | null) -> Async /// Creates an asynchronous computation that captures the current /// success, exception and cancellation continuations. The callback must @@ -708,7 +708,7 @@ namespace Microsoft.FSharp.Control /// Awaiting Results /// /// - static member AwaitEvent: event:IEvent<'Del,'T> * ?cancelAction : (unit -> unit) -> Async<'T> when 'Del : delegate<'T,unit> and 'Del :> System.Delegate + static member AwaitEvent: event:IEvent<'Del,'T> * ?cancelAction : (unit -> unit) -> Async<'T> when 'Del : delegate<'T,unit> and 'Del :> Delegate /// Creates an asynchronous computation that will wait on the given WaitHandle. /// @@ -738,7 +738,7 @@ namespace Microsoft.FSharp.Control /// Awaiting Results /// /// - static member AwaitIAsyncResult: iar: System.IAsyncResult * ?millisecondsTimeout:int -> Async + static member AwaitIAsyncResult: iar: IAsyncResult * ?millisecondsTimeout:int -> Async /// Return an asynchronous computation that will wait for the given task to complete and return /// its result. @@ -860,7 +860,7 @@ namespace Microsoft.FSharp.Control /// Legacy .NET Async Interoperability /// /// - static member FromBeginEnd : beginAction:(System.AsyncCallback * objnull -> System.IAsyncResult) * endAction:(System.IAsyncResult -> 'T) * ?cancelAction : (unit -> unit) -> Async<'T> + static member FromBeginEnd : beginAction:(AsyncCallback * objnull -> IAsyncResult) * endAction:(IAsyncResult -> 'T) * ?cancelAction : (unit -> unit) -> Async<'T> /// /// Creates an asynchronous computation in terms of a Begin/End pair of actions in @@ -885,7 +885,7 @@ namespace Microsoft.FSharp.Control /// Legacy .NET Async Interoperability /// /// - static member FromBeginEnd : arg:'Arg1 * beginAction:('Arg1 * System.AsyncCallback * objnull -> System.IAsyncResult) * endAction:(System.IAsyncResult -> 'T) * ?cancelAction : (unit -> unit) -> Async<'T> + static member FromBeginEnd : arg:'Arg1 * beginAction:('Arg1 * AsyncCallback * objnull -> IAsyncResult) * endAction:(IAsyncResult -> 'T) * ?cancelAction : (unit -> unit) -> Async<'T> /// /// Creates an asynchronous computation in terms of a Begin/End pair of actions in @@ -909,7 +909,7 @@ namespace Microsoft.FSharp.Control /// Legacy .NET Async Interoperability /// /// - static member FromBeginEnd : arg1:'Arg1 * arg2:'Arg2 * beginAction:('Arg1 * 'Arg2 * System.AsyncCallback * objnull -> System.IAsyncResult) * endAction:(System.IAsyncResult -> 'T) * ?cancelAction : (unit -> unit) -> Async<'T> + static member FromBeginEnd : arg1:'Arg1 * arg2:'Arg2 * beginAction:('Arg1 * 'Arg2 * AsyncCallback * objnull -> IAsyncResult) * endAction:(IAsyncResult -> 'T) * ?cancelAction : (unit -> unit) -> Async<'T> /// Creates an asynchronous computation in terms of a Begin/End pair of actions in /// the style used in .NET 2.0 APIs. @@ -933,7 +933,7 @@ namespace Microsoft.FSharp.Control /// Legacy .NET Async Interoperability /// /// - static member FromBeginEnd : arg1:'Arg1 * arg2:'Arg2 * arg3:'Arg3 * beginAction:('Arg1 * 'Arg2 * 'Arg3 * System.AsyncCallback * objnull -> System.IAsyncResult) * endAction:(System.IAsyncResult -> 'T) * ?cancelAction : (unit -> unit) -> Async<'T> + static member FromBeginEnd : arg1:'Arg1 * arg2:'Arg2 * arg3:'Arg3 * beginAction:('Arg1 * 'Arg2 * 'Arg3 * AsyncCallback * objnull -> IAsyncResult) * endAction:(IAsyncResult -> 'T) * ?cancelAction : (unit -> unit) -> Async<'T> /// Creates three functions that can be used to implement the .NET 1.0 Asynchronous /// Programming Model (APM) for a given asynchronous computation. @@ -948,11 +948,11 @@ namespace Microsoft.FSharp.Control /// static member AsBeginEnd : computation:('Arg -> Async<'T>) -> // The 'Begin' member - ('Arg * System.AsyncCallback * objnull -> System.IAsyncResult) * + ('Arg * AsyncCallback * objnull -> IAsyncResult) * // The 'End' member - (System.IAsyncResult -> 'T) * + (IAsyncResult -> 'T) * // The 'Cancel' member - (System.IAsyncResult -> unit) + (IAsyncResult -> unit) /// Creates an asynchronous computation that runs the given computation and ignores /// its result. @@ -1325,7 +1325,7 @@ namespace Microsoft.FSharp.Control /// An asynchronous computation that binds and eventually disposes resource. /// /// - member Using: resource:'T * binder:('T -> Async<'U>) -> Async<'U> when 'T :> System.IDisposable|null + member Using: resource:'T * binder:('T -> Async<'U>) -> Async<'U> when 'T :> IDisposable|null /// Creates an asynchronous computation that runs computation, and when /// computation generates a result T, runs binder res. @@ -1459,7 +1459,7 @@ namespace Microsoft.FSharp.Control /// /// [] // give the extension member a nice, unmangled compiled name, unique within this module - member Subscribe: callback:('T -> unit) -> System.IDisposable + member Subscribe: callback:('T -> unit) -> IDisposable /// A module of extension members providing asynchronous operations for some basic Web operations. /// @@ -1503,7 +1503,7 @@ namespace Microsoft.FSharp.Control /// This will download the server response from https://www.w3.org /// [] // give the extension member a nice, unmangled compiled name, unique within this module - member AsyncDownloadString : address:System.Uri -> Async + member AsyncDownloadString : address:Uri -> Async /// Returns an asynchronous computation that, when run, will wait for the download of the given URI. /// @@ -1522,7 +1522,7 @@ namespace Microsoft.FSharp.Control /// /// Downloads the data in bytes and decodes it to a string. [] // give the extension member a nice, unmangled compiled name, unique within this module - member AsyncDownloadData : address:System.Uri -> Async + member AsyncDownloadData : address:Uri -> Async /// Returns an asynchronous computation that, when run, will wait for the download of the given URI to specified file. /// @@ -1541,7 +1541,7 @@ namespace Microsoft.FSharp.Control /// This will download the server response as a file and output it as output.html /// [] // give the extension member a nice, unmangled compiled name, unique within this module - member AsyncDownloadFile : address:System.Uri * fileName: string -> Async + member AsyncDownloadFile : address:Uri * fileName: string -> Async // Internals used by MailboxProcessor module internal AsyncBuilderImpl = diff --git a/src/FSharp.Core/event.fs b/src/FSharp.Core/event.fs index 483ea38d64f..db2bb0664b9 100644 --- a/src/FSharp.Core/event.fs +++ b/src/FSharp.Core/event.fs @@ -28,8 +28,8 @@ module private Atomic = exchanged <- true [] -type DelegateEvent<'Delegate when 'Delegate :> System.Delegate>() = - let mutable multicast: System.Delegate = null +type DelegateEvent<'Delegate when 'Delegate :> Delegate>() = + let mutable multicast: Delegate = null member x.Trigger(args: objnull array) = match multicast with @@ -39,13 +39,13 @@ type DelegateEvent<'Delegate when 'Delegate :> System.Delegate>() = member x.Publish = { new IDelegateEvent<'Delegate> with member x.AddHandler(d) = - Atomic.setWith (fun value -> System.Delegate.Combine(value, d)) &multicast + Atomic.setWith (fun value -> Delegate.Combine(value, d)) &multicast member x.RemoveHandler(d) = - Atomic.setWith (fun value -> System.Delegate.Remove(value, d)) &multicast + Atomic.setWith (fun value -> Delegate.Remove(value, d)) &multicast } -type EventDelegee<'Args>(observer: System.IObserver<'Args>) = +type EventDelegee<'Args>(observer: IObserver<'Args>) = static let makeTuple = if Microsoft.FSharp.Reflection.FSharpType.IsTuple(typeof<'Args>) then Microsoft.FSharp.Reflection.FSharpValue.PreComputeTupleConstructor(typeof<'Args>) @@ -81,7 +81,7 @@ type EventWrapper<'Delegate, 'Args> = delegate of 'Delegate * objnull * 'Args -> [] type Event<'Delegate, 'Args - when 'Delegate: delegate<'Args, unit> and 'Delegate :> System.Delegate and 'Delegate: not struct>() = + when 'Delegate: delegate<'Args, unit> and 'Delegate :> Delegate and 'Delegate: not struct>() = let mutable multicast: 'Delegate = Unchecked.defaultof<_> @@ -146,11 +146,11 @@ type Event<'Delegate, 'Args "" interface IEvent<'Delegate, 'Args> with member e.AddHandler(d) = - Atomic.setWith (fun value -> System.Delegate.Combine(value, d) :?> 'Delegate) &multicast + Atomic.setWith (fun value -> Delegate.Combine(value, d) :?> 'Delegate) &multicast member e.RemoveHandler(d) = - Atomic.setWith (fun value -> System.Delegate.Remove(value, d) :?> 'Delegate) &multicast - interface System.IObservable<'Args> with + Atomic.setWith (fun value -> Delegate.Remove(value, d) :?> 'Delegate) &multicast + interface IObservable<'Args> with member e.Subscribe(observer) = let obj = new EventDelegee<'Args>(observer) @@ -158,7 +158,7 @@ type Event<'Delegate, 'Args (e :?> IDelegateEvent<'Delegate>).AddHandler(h) - { new System.IDisposable with + { new IDisposable with member x.Dispose() = (e :?> IDelegateEvent<'Delegate>).RemoveHandler(h) } @@ -180,16 +180,16 @@ type Event<'T> = "" interface IEvent<'T> with member e.AddHandler(d) = - Atomic.setWith (fun value -> System.Delegate.Combine(value, d) :?> Handler<'T>) &x.multicast + Atomic.setWith (fun value -> Delegate.Combine(value, d) :?> Handler<'T>) &x.multicast member e.RemoveHandler(d) = - Atomic.setWith (fun value -> System.Delegate.Remove(value, d) :?> Handler<'T>) &x.multicast - interface System.IObservable<'T> with + Atomic.setWith (fun value -> Delegate.Remove(value, d) :?> Handler<'T>) &x.multicast + interface IObservable<'T> with member e.Subscribe(observer) = let h = new Handler<_>(fun sender args -> observer.OnNext(args)) (e :?> IEvent<_, _>).AddHandler(h) - { new System.IDisposable with + { new IDisposable with member x.Dispose() = (e :?> IEvent<_, _>).RemoveHandler(h) } diff --git a/src/FSharp.Core/event.fsi b/src/FSharp.Core/event.fsi index 0a52d440c0e..39e229ba357 100644 --- a/src/FSharp.Core/event.fsi +++ b/src/FSharp.Core/event.fsi @@ -12,7 +12,7 @@ open Microsoft.FSharp.Collections /// /// Events and Observables [] -type DelegateEvent<'Delegate when 'Delegate :> System.Delegate> = +type DelegateEvent<'Delegate when 'Delegate :> Delegate> = /// Creates an event object suitable for implementing an arbitrary type of delegate. /// The event object. /// @@ -35,7 +35,7 @@ type DelegateEvent<'Delegate when 'Delegate :> System.Delegate> = /// Events and Observables [] type Event<'Delegate, 'Args - when 'Delegate: delegate<'Args, unit> and 'Delegate :> System.Delegate and 'Delegate: not struct> = + when 'Delegate: delegate<'Args, unit> and 'Delegate :> Delegate and 'Delegate: not struct> = /// Creates an event object suitable for delegate types following the standard .NET Framework convention of a first 'sender' argument. /// The created event. diff --git a/src/FSharp.Core/fslib-extra-pervasives.fs b/src/FSharp.Core/fslib-extra-pervasives.fs index 08d4ee2308b..62ca55ac051 100644 --- a/src/FSharp.Core/fslib-extra-pervasives.fs +++ b/src/FSharp.Core/fslib-extra-pervasives.fs @@ -29,7 +29,7 @@ module ExtraTopLevelOperators = [] let set elements = - Collections.Set.ofSeq elements + Set.ofSeq elements let dummyArray = [||] @@ -360,24 +360,24 @@ type MeasureOne = class end [] type TypeProviderAttribute() = - inherit System.Attribute() + inherit Attribute() [] type TypeProviderAssemblyAttribute(assemblyName: string) = - inherit System.Attribute() + inherit Attribute() new() = TypeProviderAssemblyAttribute(null) member _.AssemblyName = assemblyName [] type TypeProviderXmlDocAttribute(commentText: string) = - inherit System.Attribute() + inherit Attribute() member _.CommentText = commentText [] type TypeProviderDefinitionLocationAttribute() = - inherit System.Attribute() + inherit Attribute() let mutable filePath: string = null let mutable line: int = 0 let mutable column: int = 0 @@ -400,7 +400,7 @@ type TypeProviderDefinitionLocationAttribute() = ||| AttributeTargets.Delegate, AllowMultiple = false)>] type TypeProviderEditorHideMethodsAttribute() = - inherit System.Attribute() + inherit Attribute() /// Additional type attribute flags related to provided types type TypeProviderTypeAttributes = @@ -415,7 +415,7 @@ type TypeProviderConfig let mutable temporaryFolder: string = null let mutable isInvalidationSupported: bool = false let mutable useResolutionFolderAtRuntime: bool = false - let mutable systemRuntimeAssemblyVersion: System.Version = null + let mutable systemRuntimeAssemblyVersion: Version = null new(systemRuntimeContainsType) = TypeProviderConfig(systemRuntimeContainsType, getReferencedAssembliesOption = None) @@ -471,7 +471,7 @@ type IProvidedNamespace = abstract ResolveTypeName: typeName: string -> (Type | null) type ITypeProvider = - inherit System.IDisposable + inherit IDisposable abstract GetNamespaces: unit -> IProvidedNamespace array @@ -483,9 +483,9 @@ type ITypeProvider = abstract GetInvokerExpression: syntheticMethodBase: MethodBase * parameters: Expr array -> Expr [] - abstract Invalidate: IEvent + abstract Invalidate: IEvent - abstract GetGeneratedAssemblyContents: assembly: System.Reflection.Assembly -> byte array + abstract GetGeneratedAssemblyContents: assembly: Assembly -> byte array type ITypeProvider2 = abstract GetStaticParametersForMethod: methodWithoutArguments: MethodBase -> ParameterInfo array diff --git a/src/FSharp.Core/fslib-extra-pervasives.fsi b/src/FSharp.Core/fslib-extra-pervasives.fsi index 898cb94eb55..1960408c727 100644 --- a/src/FSharp.Core/fslib-extra-pervasives.fsi +++ b/src/FSharp.Core/fslib-extra-pervasives.fsi @@ -387,7 +387,7 @@ namespace Microsoft.FSharp.Core.CompilerServices /// Place on a class that implements ITypeProvider to extend the compiler [] type TypeProviderAttribute = - inherit System.Attribute + inherit Attribute /// Creates an instance of the attribute /// TypeProviderAttribute @@ -402,7 +402,7 @@ namespace Microsoft.FSharp.Core.CompilerServices /// assembly that contains a type provider. Runtime and design-time assembly may be the same. [] type TypeProviderAssemblyAttribute = - inherit System.Attribute + inherit Attribute /// Creates an instance of the attribute /// TypeProviderAssemblyAttribute @@ -420,7 +420,7 @@ namespace Microsoft.FSharp.Core.CompilerServices /// a provided type or member. [] type TypeProviderXmlDocAttribute = - inherit System.Attribute + inherit Attribute /// Creates an instance of the attribute /// TypeProviderXmlDocAttribute @@ -432,7 +432,7 @@ namespace Microsoft.FSharp.Core.CompilerServices /// A type provider may provide an instance of this attribute to indicate the definition location for a provided type or member. [] type TypeProviderDefinitionLocationAttribute = - inherit System.Attribute + inherit Attribute new : unit -> TypeProviderDefinitionLocationAttribute /// Gets or sets the file path for the definition location. @@ -447,7 +447,7 @@ namespace Microsoft.FSharp.Core.CompilerServices /// Indicates that a code editor should hide all System.Object methods from the intellisense menus for instances of a provided type [] type TypeProviderEditorHideMethodsAttribute = - inherit System.Attribute + inherit Attribute /// Creates an instance of the attribute /// TypeProviderEditorHideMethodsAttribute @@ -482,7 +482,7 @@ namespace Microsoft.FSharp.Core.CompilerServices member IsHostedExecution : bool with get,set /// version of referenced system runtime assembly - member SystemRuntimeAssemblyVersion : System.Version with get,set + member SystemRuntimeAssemblyVersion : Version with get,set /// Checks if given type exists in target system runtime library member SystemRuntimeContainsType : string -> bool @@ -515,7 +515,7 @@ namespace Microsoft.FSharp.Core.CompilerServices /// Represents an instantiation of a type provider component. /// type ITypeProvider = - inherit System.IDisposable + inherit IDisposable /// /// Gets the namespaces provided by the type provider. @@ -558,7 +558,7 @@ namespace Microsoft.FSharp.Core.CompilerServices /// Triggered when an assumption changes that invalidates the resolutions so far reported by the provider /// [] - abstract Invalidate : IEvent + abstract Invalidate : IEvent /// /// Get the physical contents of the given logical provided assembly. diff --git a/src/FSharp.Core/list.fs b/src/FSharp.Core/list.fs index 7fc02845d3a..73adbdb3aac 100644 --- a/src/FSharp.Core/list.fs +++ b/src/FSharp.Core/list.fs @@ -714,9 +714,9 @@ module List = [] let inline sum (list: 'T list) = match list with - | [] -> LanguagePrimitives.GenericZero<'T> + | [] -> GenericZero<'T> | t -> - let mutable acc = LanguagePrimitives.GenericZero<'T> + let mutable acc = GenericZero<'T> for x in t do acc <- Checked.(+) acc x @@ -726,9 +726,9 @@ module List = [] let inline sumBy ([] projection: 'T -> 'U) (list: 'T list) = match list with - | [] -> LanguagePrimitives.GenericZero<'U> + | [] -> GenericZero<'U> | t -> - let mutable acc = LanguagePrimitives.GenericZero<'U> + let mutable acc = GenericZero<'U> for x in t do acc <- Checked.(+) acc (projection x) @@ -800,28 +800,28 @@ module List = match list with | [] -> invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString | xs -> - let mutable sum = LanguagePrimitives.GenericZero<'T> + let mutable sum = GenericZero<'T> let mutable count = 0 for x in xs do sum <- Checked.(+) sum x count <- count + 1 - LanguagePrimitives.DivideByInt sum count + DivideByInt sum count [] let inline averageBy ([] projection: 'T -> 'U) (list: 'T list) = match list with | [] -> invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString | xs -> - let mutable sum = LanguagePrimitives.GenericZero<'U> + let mutable sum = GenericZero<'U> let mutable count = 0 for x in xs do sum <- Checked.(+) sum (projection x) count <- count + 1 - LanguagePrimitives.DivideByInt sum count + DivideByInt sum count [] let collect mapping list = diff --git a/src/FSharp.Core/local.fs b/src/FSharp.Core/local.fs index a1c9c2fa644..e79003b4d98 100644 --- a/src/FSharp.Core/local.fs +++ b/src/FSharp.Core/local.fs @@ -1097,7 +1097,7 @@ module internal Array = let places = zeroCreateUnchecked len for i = 0 to len - 1 do places.[i] <- i - System.Array.Sort<_, _>(keys, places, cFast) + Array.Sort<_, _>(keys, places, cFast) // 'array2' is a copy of the original values let array2 = (array.Clone() :?> 'T array) diff --git a/src/FSharp.Core/mailbox.fs b/src/FSharp.Core/mailbox.fs index a6fdd418e26..ee03db1c8d3 100644 --- a/src/FSharp.Core/mailbox.fs +++ b/src/FSharp.Core/mailbox.fs @@ -115,7 +115,7 @@ type Mailbox<'Msg>(cancellationSupported: bool, isThrowExceptionAfterDisposed: b member _.inbox = match inboxStore with - | null -> inboxStore <- new System.Collections.Generic.List<'Msg>(1) + | null -> inboxStore <- new List<'Msg>(1) | _ -> () inboxStore @@ -333,7 +333,7 @@ type Mailbox<'Msg>(cancellationSupported: bool, isThrowExceptionAfterDisposed: b | Some res -> return res } - interface System.IDisposable with + interface IDisposable with member _.Dispose() = lock syncRoot (fun () -> if isNotNull inboxStore then @@ -367,7 +367,7 @@ type MailboxProcessor<'Msg>(body, isThrowExceptionAfterDisposed, ?cancellationTo let mailbox = new Mailbox<'Msg>(cancellationSupported, isThrowExceptionAfterDisposed) - let mutable defaultTimeout = Threading.Timeout.Infinite + let mutable defaultTimeout = Timeout.Infinite let mutable started = false let errorEvent = new Event() @@ -454,7 +454,7 @@ type MailboxProcessor<'Msg>(body, isThrowExceptionAfterDisposed, ?cancellationTo mailbox.Post msg match timeout with - | Threading.Timeout.Infinite when not cancellationSupported -> + | Timeout.Infinite when not cancellationSupported -> async { let! result = resultCell.AwaitResult_NoDirectCancelOrTimeout return Some result @@ -478,7 +478,7 @@ type MailboxProcessor<'Msg>(body, isThrowExceptionAfterDisposed, ?cancellationTo let timeout = defaultArg timeout defaultTimeout match timeout with - | Threading.Timeout.Infinite when not cancellationSupported -> + | Timeout.Infinite when not cancellationSupported -> // Nothing to dispose, no wait handles used let resultCell = new ResultCell<_>() @@ -515,7 +515,7 @@ type MailboxProcessor<'Msg>(body, isThrowExceptionAfterDisposed, ?cancellationTo member x.Dispose() = (x :> IDisposable).Dispose() - interface System.IDisposable with + interface IDisposable with member _.Dispose() = (mailbox :> IDisposable).Dispose() diff --git a/src/FSharp.Core/map.fs b/src/FSharp.Core/map.fs index 4eeed1465a1..2fd80f177e5 100644 --- a/src/FSharp.Core/map.fs +++ b/src/FSharp.Core/map.fs @@ -635,7 +635,7 @@ module MapTree = { new IEnumerator<_> with member _.Current = current i - interface System.Collections.IEnumerator with + interface IEnumerator with member _.Current = box (current i) member _.MoveNext() = @@ -643,7 +643,7 @@ module MapTree = member _.Reset() = i <- mkIterator m - interface System.IDisposable with + interface IDisposable with member _.Dispose() = () } @@ -674,18 +674,18 @@ module MapTree = else rightmost nd.Right -[>)>] -[] +[>)>] +[] [] [] type Map<[] 'Key, [] 'Value when 'Key: comparison> (comparer: IComparer<'Key>, tree: MapTree<'Key, 'Value>) = - [] + [] // This type is logically immutable. This field is only mutated during deserialization. let mutable comparer = comparer - [] + [] // This type is logically immutable. This field is only mutated during deserialization. let mutable tree = tree @@ -957,7 +957,7 @@ type Map<[] 'Key, [ as m2 -> diff --git a/src/FSharp.Core/map.fsi b/src/FSharp.Core/map.fsi index 2fdabdbb29f..dba37379f64 100644 --- a/src/FSharp.Core/map.fsi +++ b/src/FSharp.Core/map.fsi @@ -210,7 +210,7 @@ type Map<[] 'Key, [ interface ICollection> interface IEnumerable> - interface System.IComparable + interface IComparable interface System.Collections.IStructuralEquatable interface System.Collections.IEnumerable interface IReadOnlyCollection> diff --git a/src/FSharp.Core/math/z.fs b/src/FSharp.Core/math/z.fs index f3eec1b950e..a443ce64e64 100644 --- a/src/FSharp.Core/math/z.fs +++ b/src/FSharp.Core/math/z.fs @@ -47,7 +47,7 @@ module NumericLiterals = FromInt64Dynamic(int64 x32) let inline isOX s = - not (System.String.IsNullOrEmpty(s)) + not (String.IsNullOrEmpty(s)) && s.Length > 2 && s.[0] = '0' && s.[1] = 'x' diff --git a/src/FSharp.Core/observable.fsi b/src/FSharp.Core/observable.fsi index b415b7c3086..fbf68e7c912 100644 --- a/src/FSharp.Core/observable.fsi +++ b/src/FSharp.Core/observable.fsi @@ -299,7 +299,7 @@ module Observable = /// The sample evaluates to: 1, 2, 3 /// [] - val subscribe: callback: ('T -> unit) -> source: IObservable<'T> -> System.IDisposable + val subscribe: callback: ('T -> unit) -> source: IObservable<'T> -> IDisposable /// Returns a new observable that triggers on the second and subsequent triggerings of the input observable. /// The Nth triggering of the input observable passes the arguments from the N-1th and Nth triggering as diff --git a/src/FSharp.Core/prim-types-prelude.fsi b/src/FSharp.Core/prim-types-prelude.fsi index a32ccdbf105..e21a8f48d33 100644 --- a/src/FSharp.Core/prim-types-prelude.fsi +++ b/src/FSharp.Core/prim-types-prelude.fsi @@ -16,7 +16,7 @@ namespace Microsoft.FSharp.Core /// An abbreviation for the CLI type . /// /// Basic Types - type obj = System.Object + type obj = Object /// An abbreviation for the CLI type or null. /// With the 'nullable reference types' feature, this is an alias to 'obj | null'. @@ -27,107 +27,107 @@ namespace Microsoft.FSharp.Core /// An abbreviation for the CLI type . /// /// Basic Types - type exn = System.Exception + type exn = Exception /// An abbreviation for the CLI type . /// /// Basic Types - type nativeint = System.IntPtr + type nativeint = IntPtr /// An abbreviation for the CLI type . /// /// Basic Types - type unativeint = System.UIntPtr + type unativeint = UIntPtr /// An abbreviation for the CLI type . /// /// Basic Types - type string = System.String + type string = String /// An abbreviation for the CLI type . /// /// Basic Types - type float32 = System.Single + type float32 = Single /// An abbreviation for the CLI type . /// /// Basic Types - type float = System.Double + type float = Double /// An abbreviation for the CLI type . Identical to . /// /// Basic Types - type single = System.Single + type single = Single /// An abbreviation for the CLI type . Identical to . /// /// Basic Types - type double = System.Double + type double = Double /// An abbreviation for the CLI type . /// /// Basic Types - type sbyte = System.SByte + type sbyte = SByte /// An abbreviation for the CLI type . /// /// Basic Types - type byte = System.Byte + type byte = Byte /// An abbreviation for the CLI type . /// /// Basic Types - type int8 = System.SByte + type int8 = SByte /// An abbreviation for the CLI type . /// /// Basic Types - type uint8 = System.Byte + type uint8 = Byte /// An abbreviation for the CLI type . /// /// Basic Types - type int16 = System.Int16 + type int16 = Int16 /// An abbreviation for the CLI type . /// /// Basic Types - type uint16 = System.UInt16 + type uint16 = UInt16 /// An abbreviation for the CLI type . /// /// Basic Types - type int32 = System.Int32 + type int32 = Int32 /// An abbreviation for the CLI type . /// /// Basic Types - type uint32 = System.UInt32 + type uint32 = UInt32 /// An abbreviation for the CLI type . /// /// Basic Types - type int64 = System.Int64 + type int64 = Int64 /// An abbreviation for the CLI type . /// /// Basic Types - type uint64 = System.UInt64 + type uint64 = UInt64 /// An abbreviation for the CLI type . /// /// Basic Types - type char = System.Char + type char = Char /// An abbreviation for the CLI type . /// /// Basic Types - type bool = System.Boolean + type bool = Boolean /// An abbreviation for the CLI type . /// /// Basic Types - type decimal = System.Decimal + type decimal = Decimal /// An abbreviation for the CLI type . /// diff --git a/src/FSharp.Core/prim-types.fs b/src/FSharp.Core/prim-types.fs index 6b43c445338..7e30997a842 100644 --- a/src/FSharp.Core/prim-types.fs +++ b/src/FSharp.Core/prim-types.fs @@ -28,7 +28,7 @@ namespace Microsoft.FSharp.Core override _.Equals(obj:objnull) = match obj with null -> true | :? Unit -> true | _ -> false - interface System.IComparable with + interface IComparable with member _.CompareTo(_obj:objnull) = 0 and unit = Unit @@ -227,7 +227,7 @@ namespace Microsoft.FSharp.Core variantNumber:int, sequenceNumber:int, resourceName:string, - typeDefinitions:System.Type array) = + typeDefinitions:Type array) = inherit Attribute() member _.SourceConstructFlags = sourceConstructFlags member _.SequenceNumber = sequenceNumber @@ -389,7 +389,7 @@ namespace Microsoft.FSharp.Core [] [] type TailCallAttribute() = - inherit System.Attribute() + inherit Attribute() namespace Microsoft.FSharp.Core.CompilerServices @@ -537,7 +537,7 @@ namespace Microsoft.FSharp.Core let inline (+..) (x:uint64) (y:uint64) = (# "add" x y : uint64 #) let inline ( *. ) (x:int64) (y:int64) = (# "mul" x y : int64 #) let inline ( *.. ) (x:uint64) (y:uint64) = (# "mul" x y : uint64 #) - let inline (^) (x:string) (y:string) = System.String.Concat(x,y) + let inline (^) (x:string) (y:string) = String.Concat(x,y) let inline (<<<) (x:int) (y:int) = (# "shl" x y : int #) let inline ( * ) (x:int) (y:int) = (# "mul" x y : int #) let inline (-) (x:int) (y:int) = (# "sub" x y : int #) @@ -548,7 +548,7 @@ namespace Microsoft.FSharp.Core let inline ignore _ = () let inline intOfByte (b:byte) = (# "" b : int #) - let inline raise (e: System.Exception) = (# "throw" e : 'U #) + let inline raise (e: Exception) = (# "throw" e : 'U #) let inline length (x: 'T array) = (# "ldlen conv.i4" x : int #) let inline zeroCreate (n:int) = (# "newarr !0" type ('T) n : 'T array #) let inline get (arr: 'T array) (n:int) = (# "ldelem.any !0" type ('T) arr n : 'T #) @@ -570,7 +570,7 @@ namespace Microsoft.FSharp.Core let inline typeof<'T> = let tok = (# "ldtoken !0" type('T) : System.RuntimeTypeHandle #) - System.Type.GetTypeFromHandle(tok) + Type.GetTypeFromHandle(tok) let inline typedefof<'T> = let ty = typeof<'T> @@ -665,13 +665,13 @@ namespace Microsoft.FSharp.Core [] let inline (~&) (obj : 'T) : byref<'T> = ignore obj // pretend the variable is used - let e = new System.ArgumentException(ErrorStrings.AddressOpNotFirstClassString) + let e = new ArgumentException(ErrorStrings.AddressOpNotFirstClassString) (# "throw" (e :> System.Exception) : byref<'T> #) [] let inline (~&&) (obj : 'T) : nativeptr<'T> = ignore obj // pretend the variable is used - let e = new System.ArgumentException(ErrorStrings.AddressOpNotFirstClassString) + let e = new ArgumentException(ErrorStrings.AddressOpNotFirstClassString) (# "throw" (e :> System.Exception) : nativeptr<'T> #) open IntrinsicOperators @@ -735,7 +735,7 @@ namespace Microsoft.FSharp.Core unboxPrim<'T>(source) else //System.Console.WriteLine("UnboxGeneric, x = {0}, 'T = {1}", x, typeof<'T>) - raise (System.NullReferenceException()) + raise (NullReferenceException()) // better: source is NOT TypeNullnessSemantics_NullNotLiked let inline UnboxFast<'T>(source: objnull) = @@ -773,7 +773,7 @@ namespace Microsoft.FSharp.Core let inline GetString (source: string) (index:int) = source.Chars(index) let inline CreateInstance<'T when 'T : (new : unit -> 'T) >() = - (System.Activator.CreateInstance() : 'T) + (Activator.CreateInstance() : 'T) let inline GetArray (source: 'T array) (index:int) = (# "ldelem.any !0" type ('T) source index : 'T #) @@ -802,7 +802,7 @@ namespace Microsoft.FSharp.Core match dim with | 0 -> GetArray2DLength1 arr | 1 -> GetArray2DLength2 arr - | _ -> raise (System.IndexOutOfRangeException()) + | _ -> raise (IndexOutOfRangeException()) let inline Array2DZeroCreate (n:int) (m:int) = (# "newarr.multi 2 !0" type ('T) n m : 'T[,] #) @@ -838,7 +838,7 @@ namespace Microsoft.FSharp.Core | 0 -> GetArray3DLength1 arr | 1 -> GetArray3DLength2 arr | 2 -> GetArray3DLength3 arr - | _ -> raise (System.IndexOutOfRangeException()) + | _ -> raise (IndexOutOfRangeException()) let inline Array3DZeroCreate (n1:int) (n2:int) (n3:int) = (# "newarr.multi 3 !0" type ('T) n1 n2 n3 : 'T[,,] #) @@ -880,7 +880,7 @@ namespace Microsoft.FSharp.Core | 1 -> GetArray4DLength2 arr | 2 -> GetArray4DLength3 arr | 3 -> GetArray4DLength4 arr - | _ -> raise (System.IndexOutOfRangeException()) + | _ -> raise (IndexOutOfRangeException()) let inline Array4DZeroCreate (n1:int) (n2:int) (n3:int) (n4:int) = (# "newarr.multi 4 !0" type ('T) n1 n2 n3 n4 : 'T[,,,] #) @@ -1000,7 +1000,7 @@ namespace Microsoft.FSharp.Core acc // special case - arrays do not by default have a decent structural hashing function - let GenericHashArbArray (iec : IEqualityComparer) (x: System.Array) : int = + let GenericHashArbArray (iec : IEqualityComparer) (x: Array) : int = match x.Rank with | 1 -> let b = x.GetLowerBound(0) @@ -1024,7 +1024,7 @@ namespace Microsoft.FSharp.Core let rec GenericHashParamObj (iec : IEqualityComparer) (x: objnull) : int = match x with | null -> 0 - | (:? System.Array as a) -> + | (:? Array as a) -> match a with | :? (obj array) as oa -> GenericHashObjArray iec oa | :? (byte array) as ba -> GenericHashByteArray ba @@ -1069,7 +1069,7 @@ namespace Microsoft.FSharp.Core //------------------------------------------------------------------------- let FailGenericComparison (obj: obj) = - raise (new System.ArgumentException(String.Format(SR.GetString(SR.genericCompareFail1), obj.GetType().ToString()))) + raise (new ArgumentException(String.Format(SR.GetString(SR.genericCompareFail1), obj.GetType().ToString()))) /// This type has two instances - fsComparerER and fsComparerThrow. @@ -1081,7 +1081,7 @@ namespace Microsoft.FSharp.Core /// The unique exception object that is thrown locally when NaNs are compared in PER mode (by fsComparerPER) /// This exception should never be observed by user code. - let NaNException = new System.Exception() + let NaNException = new Exception() /// Implements generic comparison between two objects. This corresponds to the pseudo-code in the F# /// specification. The treatment of NaNs is governed by "comp". @@ -1093,10 +1093,10 @@ namespace Microsoft.FSharp.Core // Use Ordinal comparison for strings | (:? string as x),(:? string as y) -> - System.String.CompareOrdinal(x, y) + String.CompareOrdinal(x, y) // Permit structural comparison on arrays - | (:? System.Array as arr1),_ -> + | (:? Array as arr1),_ -> match arr1,yobj with // Fast path | (:? (obj array) as arr1), (:? (obj array) as arr2) -> @@ -1104,7 +1104,7 @@ namespace Microsoft.FSharp.Core // Fast path | (:? (byte array) as arr1), (:? (byte array) as arr2) -> GenericComparisonByteArray arr1 arr2 - | _, (:? System.Array as arr2) -> + | _, (:? Array as arr2) -> GenericComparisonArbArrayWithComparer comp arr1 arr2 | _ -> FailGenericComparison xobj @@ -1114,14 +1114,14 @@ namespace Microsoft.FSharp.Core x.CompareTo(yobj,comp) // Check for IComparable - | (:? System.IComparable as x),_ -> + | (:? IComparable as x),_ -> if comp.ThrowsOnPER then match xobj,yobj with | (:? float as x),(:? float as y) -> - if (System.Double.IsNaN x || System.Double.IsNaN y) then + if (Double.IsNaN x || Double.IsNaN y) then raise NaNException | (:? float32 as x),(:? float32 as y) -> - if (System.Single.IsNaN x || System.Single.IsNaN y) then + if (Single.IsNaN x || Single.IsNaN y) then raise NaNException | _ -> () x.CompareTo(yobj) @@ -1136,7 +1136,7 @@ namespace Microsoft.FSharp.Core let res = yc.CompareTo(xobj,comp) if res < 0 then 1 elif res > 0 then -1 else 0 - | _,(:? System.IComparable as yc) -> + | _,(:? IComparable as yc) -> // Note -c doesn't work here: be careful of comparison function returning minint let c = yc.CompareTo(xobj) if c < 0 then 1 elif c > 0 then -1 else 0 @@ -1144,7 +1144,7 @@ namespace Microsoft.FSharp.Core | _ -> FailGenericComparison xobj /// specialcase: Core implementation of structural comparison on arbitrary arrays. - and GenericComparisonArbArrayWithComparer (comp:GenericComparer) (x:System.Array) (y:System.Array) : int = + and GenericComparisonArbArrayWithComparer (comp:GenericComparer) (x:Array) (y:Array) : int = if x.Rank = 1 && y.Rank = 1 then let lenx = x.LongLength let leny = y.LongLength @@ -1590,9 +1590,9 @@ namespace Microsoft.FSharp.Core | null,null -> true | null,_ -> false | _,null -> false - | (:? string as xs),(:? string as ys) -> System.String.Equals(xs,ys) + | (:? string as xs),(:? string as ys) -> String.Equals(xs,ys) // Permit structural equality on arrays - | (:? System.Array as arr1),_ -> + | (:? Array as arr1),_ -> match arr1,yobj with // Fast path | (:? (obj array) as arr1), (:? (obj array) as arr2) -> GenericEqualityObjArray er iec arr1 arr2 @@ -1603,7 +1603,7 @@ namespace Microsoft.FSharp.Core | (:? (char array) as arr1), (:? (char array) as arr2) -> GenericEqualityCharArray arr1 arr2 | (:? (float32 array) as arr1), (:? (float32 array) as arr2) -> GenericEqualitySingleArray er arr1 arr2 | (:? (float array) as arr1), (:? (float array) as arr2) -> GenericEqualityDoubleArray er arr1 arr2 - | _, (:? System.Array as arr2) -> GenericEqualityArbArray er iec arr1 arr2 + | _, (:? Array as arr2) -> GenericEqualityArbArray er iec arr1 arr2 | _ -> xobj.Equals(yobj) | (:? IStructuralEquatable as x1),_ -> x1.Equals(yobj,iec) // Ensure ER NaN semantics on recursive calls @@ -1616,7 +1616,7 @@ namespace Microsoft.FSharp.Core | _ -> xobj.Equals(yobj) /// specialcase: Core implementation of structural equality on arbitrary arrays. - and GenericEqualityArbArray er (iec:IEqualityComparer) (x:System.Array) (y:System.Array) : bool = + and GenericEqualityArbArray er (iec:IEqualityComparer) (x:Array) (y:Array) : bool = if x.Rank = 1 && y.Rank = 1 then // check lengths let lenx = x.LongLength @@ -2538,7 +2538,7 @@ namespace Microsoft.FSharp.Core let inline UIntPtrWithMeasure (f : unativeint) : unativeint<'Measure> = retype f - let inline formatError() = raise (new System.FormatException(SR.GetString(SR.badFormatString))) + let inline formatError() = raise (new FormatException(SR.GetString(SR.badFormatString))) // Parse formats // DDDDDDDD @@ -2557,7 +2557,7 @@ namespace Microsoft.FSharp.Core // and only request AllowLeadingSign. let isOXB c = - let c = System.Char.ToLowerInvariant c + let c = Char.ToLowerInvariant c charEq c 'x' || charEq c 'o' || charEq c 'b' let is0OXB (s:string) p l = @@ -2565,7 +2565,7 @@ namespace Microsoft.FSharp.Core let get0OXB (s:string) (p:byref) l = if is0OXB s p l - then let r = System.Char.ToLowerInvariant(s.Chars(p+1)) in p <- p + 2; r + then let r = Char.ToLowerInvariant(s.Chars(p+1)) in p <- p + 2; r else 'd' let getSign32 (s:string) (p:byref) l = @@ -2590,8 +2590,8 @@ namespace Microsoft.FSharp.Core | s -> s.Replace("_", "") let ParseUInt32 (s:string) = - if System.Object.ReferenceEquals(s,null) then - raise( new System.ArgumentNullException("s") ) + if Object.ReferenceEquals(s,null) then + raise( new ArgumentNullException("s") ) let s = removeUnderscores (s.Trim()) let l = s.Length let mutable p = 0 @@ -2607,8 +2607,8 @@ namespace Microsoft.FSharp.Core let inline int64OfUInt64 (x:uint64) = (# "" x : int64 #) let ParseInt32 (s:string) = - if System.Object.ReferenceEquals(s,null) then - raise( new System.ArgumentNullException("s") ) + if Object.ReferenceEquals(s,null) then + raise( new ArgumentNullException("s") ) let s = removeUnderscores (s.Trim()) let l = s.Length let mutable p = 0 @@ -2622,8 +2622,8 @@ namespace Microsoft.FSharp.Core | _ -> Int32.Parse(s, NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture) let ParseInt64 (s:string) = - if System.Object.ReferenceEquals(s,null) then - raise( new System.ArgumentNullException("s") ) + if Object.ReferenceEquals(s,null) then + raise( new ArgumentNullException("s") ) let s = removeUnderscores (s.Trim()) let l = s.Length let mutable p = 0 @@ -2637,8 +2637,8 @@ namespace Microsoft.FSharp.Core | _ -> Int64.Parse(s, NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture) let ParseUInt64 (s:string) : uint64 = - if System.Object.ReferenceEquals(s,null) then - raise( new System.ArgumentNullException("s") ) + if Object.ReferenceEquals(s,null) then + raise( new ArgumentNullException("s") ) let s = removeUnderscores (s.Trim()) let l = s.Length let mutable p = 0 @@ -2769,7 +2769,7 @@ namespace Microsoft.FSharp.Core let staticBindingFlags = (# "" 0b111000 : BindingFlags #) // BindingFlags.Static ||| BindingFlags.Public ||| BindingFlags.NonPublic let mutable ret = null for mi in this.GetMethods staticBindingFlags do - if (System.String.Equals(mi.Name, "op_Implicit") || System.String.Equals(mi.Name, "op_Explicit")) && + if (String.Equals(mi.Name, "op_Implicit") || String.Equals(mi.Name, "op_Explicit")) && (let p = mi.GetParameters() in p.Length = 1 && (get p 0).ParameterType.IsEquivalentTo fromType) && mi.ReturnType.IsEquivalentTo toType then ret <- mi ret @@ -2796,7 +2796,7 @@ namespace Microsoft.FSharp.Core match meth with | null -> let ameth = - if System.String.Equals(opName, "op_Explicit") then + if String.Equals(opName, "op_Explicit") then let aty2 = typeof<'U> match aty.GetSingleStaticConversionOperatorByTypes(aty, aty2) with | null -> aty2.GetSingleStaticConversionOperatorByTypes(aty, aty2) @@ -3546,7 +3546,7 @@ namespace Microsoft.FSharp.Core elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.ovf.u2" (convPrim<_,float32> value) : char #) elif typeeq<'T, char> then convPrim<_,'U> value elif typeeq<'T, decimal> then convPrim<_,'U> (Decimal.op_Explicit (convPrim<_,decimal> value) : char) - elif typeeq<'T, string> then convPrim<_,'U> (System.Char.Parse (convPrim<_,string> value)) + elif typeeq<'T, string> then convPrim<_,'U> (Char.Parse (convPrim<_,string> value)) else UnaryOpDynamicImplTable.Invoke "op_Explicit" value elif typeeq<'U, decimal> then if typeeq<'T, sbyte> then convPrim<_,'U> (Convert.ToDecimal (convPrim<_,sbyte> value)) @@ -4152,7 +4152,7 @@ namespace Microsoft.FSharp.Collections | [] -> acc | h::t -> let hashOfH = GenericHashWithComparer c h - let acc = LanguagePrimitives.HashCompare.HashCombine position acc hashOfH + let acc = HashCompare.HashCombine position acc hashOfH loop t acc (position+1) loop this 0 0 @@ -4169,7 +4169,7 @@ namespace Microsoft.FSharp.Collections AbstractClass; CompiledName("FSharpList")>] List = [] - static member Create([] items: System.ReadOnlySpan<'T>) = + static member Create([] items: ReadOnlySpan<'T>) = let mutable list : 'T list = [] for i = items.Length - 1 downto 0 do list <- items[i] :: list @@ -5467,7 +5467,7 @@ namespace Microsoft.FSharp.Core module Attributes = [] - [] + [] [] // assembly is fully transparent do () @@ -5514,10 +5514,10 @@ namespace Microsoft.FSharp.Core let inline sizeof<'T> = BasicInlinedOperations.sizeof<'T> [] - let inline hash (obj: 'T) = LanguagePrimitives.GenericHash obj + let inline hash (obj: 'T) = GenericHash obj let inline limitedHash (limit:int) (obj: 'T) = - LanguagePrimitives.GenericLimitedHash limit obj + GenericLimitedHash limit obj [] let id x = x @@ -5992,7 +5992,7 @@ namespace Microsoft.FSharp.Core mutable Current : 'T } let inline variableStepIntegralRange n step m = - if step = LanguagePrimitives.GenericZero then + if step = GenericZero then invalidArg "step" (SR.GetString(SR.stepCannotBeZero)); let variableStepRangeEnumerator () = @@ -6034,12 +6034,12 @@ namespace Microsoft.FSharp.Core state.Started <- true state.Current <- n state.Complete <- - ( (step > LanguagePrimitives.GenericZero && state.Current > m) - || (step < LanguagePrimitives.GenericZero && state.Current < m)) + ( (step > GenericZero && state.Current > m) + || (step < GenericZero && state.Current < m)) else let next = state.Current + step - if (step > LanguagePrimitives.GenericZero && next > state.Current && next <= m) - || (step < LanguagePrimitives.GenericZero && next < state.Current && next >= m) then + if (step > GenericZero && next > state.Current && next <= m) + || (step < GenericZero && next < state.Current && next >= m) then state.Current <- next else state.Complete <- true @@ -6053,12 +6053,12 @@ namespace Microsoft.FSharp.Core member _.GetEnumerator () = (variableStepRangeEnumerator ()) :> IEnumerator } let inline simpleIntegralRange minValue maxValue n step m = - if step <> LanguagePrimitives.GenericOne || n > m || n = minValue || m = maxValue then + if step <> GenericOne || n > m || n = minValue || m = maxValue then variableStepIntegralRange n step m else // a constrained, common simple iterator that is fast. let singleStepRangeEnumerator () = - let mutable value = n - LanguagePrimitives.GenericOne + let mutable value = n - GenericOne let inline current () = // according to IEnumerator.Current documentation, the result of of Current @@ -6081,14 +6081,14 @@ namespace Microsoft.FSharp.Core interface IEnumerator with member _.Current = box (current ()) - member _.Reset () = value <- n - LanguagePrimitives.GenericOne + member _.Reset () = value <- n - GenericOne member _.MoveNext () = let derefValue = value if derefValue < m then - value <- derefValue + LanguagePrimitives.GenericOne + value <- derefValue + GenericOne true elif derefValue = m then - value <- derefValue + LanguagePrimitives.GenericOne + value <- derefValue + GenericOne false else false } @@ -7313,7 +7313,7 @@ namespace Microsoft.FSharp.Control open Microsoft.FSharp.Core.Operators module LazyExtensions = - type System.Lazy<'T> with + type Lazy<'T> with [] // give the extension member a 'nice', unmangled compiled name, unique within this module static member Create(creator : unit -> 'T) : Lazy<'T> = let creator = Func<'T>(creator) diff --git a/src/FSharp.Core/prim-types.fsi b/src/FSharp.Core/prim-types.fsi index 6697e108d2c..04a38847052 100644 --- a/src/FSharp.Core/prim-types.fsi +++ b/src/FSharp.Core/prim-types.fsi @@ -692,7 +692,7 @@ namespace Microsoft.FSharp.Core /// The name of the resource needed to resolve the source construct. /// /// CompilationMappingAttribute - new: resourceName:string * typeDefinitions:System.Type array -> CompilationMappingAttribute + new: resourceName:string * typeDefinitions:Type array -> CompilationMappingAttribute /// Indicates the relationship between the compiled entity and F# source code member SourceConstructFlags: SourceConstructFlags @@ -707,7 +707,7 @@ namespace Microsoft.FSharp.Core member ResourceName: string /// Indicates the type definitions needed to resolve the source construct - member TypeDefinitions: System.Type array + member TypeDefinitions: Type array /// This attribute is inserted automatically by the F# compiler to tag /// methods which are given the 'CompiledName' attribute. @@ -991,7 +991,7 @@ namespace Microsoft.FSharp.Core [] [] type TailCallAttribute = - inherit System.Attribute + inherit Attribute new : unit -> TailCallAttribute namespace Microsoft.FSharp.Core.CompilerServices @@ -2118,28 +2118,28 @@ namespace Microsoft.FSharp.Core /// The input function. /// /// A System.Converter of the function type. - static member op_Implicit: func: ('T -> 'U) -> System.Converter<'T,'U> + static member op_Implicit: func: ('T -> 'U) -> Converter<'T,'U> /// Convert an value of type to a F# first class function value /// /// The input System.Converter. /// /// An F# function of the same type. - static member op_Implicit: converter: System.Converter<'T,'U> -> ('T -> 'U) + static member op_Implicit: converter: Converter<'T,'U> -> ('T -> 'U) /// Convert an F# first class function value to a value of type /// /// The input function. /// /// System.Converter<'T,'U> - static member ToConverter: func: ('T -> 'U) -> System.Converter<'T,'U> + static member ToConverter: func: ('T -> 'U) -> Converter<'T,'U> /// Convert an value of type to a F# first class function value /// /// The input System.Converter. /// /// An F# function of the same type. - static member FromConverter: converter: System.Converter<'T,'U> -> ('T -> 'U) + static member FromConverter: converter: Converter<'T,'U> -> ('T -> 'U) /// Invoke an F# first class function value with five curried arguments. In some cases this /// will result in a more efficient application than applying the arguments successively. @@ -2752,7 +2752,7 @@ namespace Microsoft.FSharp.Collections /// /// A list containing the specified items. [] - static member Create: [] items: System.ReadOnlySpan<'T> -> 'T list + static member Create: [] items: ReadOnlySpan<'T> -> 'T list #endif /// An abbreviation for the CLI type @@ -3297,12 +3297,12 @@ namespace Microsoft.FSharp.Core /// /// [] - val inline raise: exn: System.Exception -> 'T + val inline raise: exn: Exception -> 'T /// Rethrows an exception. This should only be used when handling an exception /// The result value. [] - [] + [] val inline rethrow: unit -> 'T /// Rethrows an exception. This should only be used when handling an exception @@ -4013,7 +4013,7 @@ namespace Microsoft.FSharp.Core /// /// [] - val using: resource: ('T :> System.IDisposable) -> action: ('T -> 'U) -> 'U + val using: resource: ('T :> IDisposable) -> action: ('T -> 'U) -> 'U /// Generate a System.Type runtime representation of a static type. /// @@ -4026,7 +4026,7 @@ namespace Microsoft.FSharp.Core /// [] [] - val inline typeof<'T> : System.Type + val inline typeof<'T> : Type /// Returns the name of the given symbol. /// @@ -4044,7 +4044,7 @@ namespace Microsoft.FSharp.Core /// generation of a RuntimeMethodHandle. [] #if DEBUG - val methodhandleof: ('T -> 'TResult) -> System.RuntimeMethodHandle + val methodhandleof: ('T -> 'TResult) -> RuntimeMethodHandle #else val internal methodhandleof: ('T -> 'TResult) -> System.RuntimeMethodHandle #endif @@ -4062,7 +4062,7 @@ namespace Microsoft.FSharp.Core /// [] [] - val inline typedefof<'T> : System.Type + val inline typedefof<'T> : Type /// Returns the internal size of a type in bytes. For example, sizeof<int> returns 4. /// @@ -4904,7 +4904,7 @@ namespace Microsoft.FSharp.Core [] member GetReverseIndex: rank: int * offset: int -> int - type System.String with + type String with /// Get the index for the element offset elements away from the end of the collection. /// /// The rank of the index. @@ -6200,7 +6200,7 @@ namespace Microsoft.FSharp.Control /// CLI metadata to make the member appear to other CLI languages as a CLI event. /// /// Events and Observables - type IDelegateEvent<'Delegate when 'Delegate :> System.Delegate > = + type IDelegateEvent<'Delegate when 'Delegate :> Delegate > = /// Connect a handler delegate object to the event. A handler can /// be later removed using RemoveHandler. The listener will @@ -6222,7 +6222,7 @@ namespace Microsoft.FSharp.Control /// /// Events and Observables [] - type IEvent<'Delegate,'Args when 'Delegate: delegate<'Args,unit> and 'Delegate :> System.Delegate > = + type IEvent<'Delegate,'Args when 'Delegate: delegate<'Args,unit> and 'Delegate :> Delegate > = inherit IDelegateEvent<'Delegate> inherit IObservable<'Args> diff --git a/src/FSharp.Core/printf.fs b/src/FSharp.Core/printf.fs index b2b42f23370..69679baea38 100644 --- a/src/FSharp.Core/printf.fs +++ b/src/FSharp.Core/printf.fs @@ -91,7 +91,7 @@ module internal PrintfImpl = [] let NotSpecifiedValue = -2 - [] + [] [] type FormatSpecifier = { @@ -125,7 +125,7 @@ module internal PrintfImpl = override spec.ToString() = let valueOf n = match n with StarValue -> "*" | NotSpecifiedValue -> "-" | n -> n.ToString() - System.String.Format + String.Format ( "'{0}', Precision={1}, Width={2}, Flags={3}", spec.TypeChar, @@ -146,7 +146,7 @@ module internal PrintfImpl = padChar, prefix member spec.IsGFormat = - spec.IsDecimalFormat || System.Char.ToLower(spec.TypeChar) = 'g' + spec.IsDecimalFormat || Char.ToLower(spec.TypeChar) = 'g' /// Set of helpers to parse format string @@ -681,7 +681,7 @@ module internal PrintfImpl = /// - negative numbers, -7 should be printed as '-007', not '00-7' /// - positive numbers when prefix for positives is set: 7 should be '+007', not '00+7' let rightJustifyWithZeroAsPadChar (str: string) isNumber isPositive w (prefixForPositives: string) = - System.Diagnostics.Debug.Assert(prefixForPositives.Length = 0 || prefixForPositives.Length = 1) + Debug.Assert(prefixForPositives.Length = 0 || prefixForPositives.Length = 1) if isNumber then if isPositive then prefixForPositives + (if w = 0 then str else str.PadLeft(w - prefixForPositives.Length, '0')) // save space to @@ -696,7 +696,7 @@ module internal PrintfImpl = /// handler right justification when pad char = ' ' let rightJustifyWithSpaceAsPadChar (str: string) isNumber isPositive w (prefixForPositives: string) = - System.Diagnostics.Debug.Assert(prefixForPositives.Length = 0 || prefixForPositives.Length = 1) + Debug.Assert(prefixForPositives.Length = 0 || prefixForPositives.Length = 1) (if isNumber && isPositive then prefixForPositives + str else str).PadLeft(w, ' ') /// handles left justification with formatting with 'G'\'g' - either for decimals or with 'g'\'G' is explicitly set @@ -803,7 +803,7 @@ module internal PrintfImpl = fun (w: int) (v: objnull) -> GenericNumber.rightJustifyWithZeroAsPadChar (f v) true true w prefixForPositives else - System.Diagnostics.Debug.Assert((padChar = ' ')) + Debug.Assert((padChar = ' ')) fun (w: int) (v: objnull) -> GenericNumber.rightJustifyWithSpaceAsPadChar (f v) true true w prefixForPositives else @@ -812,7 +812,7 @@ module internal PrintfImpl = GenericNumber.rightJustifyWithZeroAsPadChar (f v) true (GenericNumber.isPositive v) w prefixForPositives else - System.Diagnostics.Debug.Assert((padChar = ' ')) + Debug.Assert((padChar = ' ')) fun (w: int) v -> GenericNumber.rightJustifyWithSpaceAsPadChar (f v) true (GenericNumber.isPositive v) w prefixForPositives @@ -896,7 +896,7 @@ module internal PrintfImpl = fun (fmt: string) (w: int) (v: obj) -> GenericNumber.rightJustifyWithZeroAsPadChar (toFormattedString fmt v) (isNumber v) (GenericNumber.isPositive v) w prefixForPositives else - System.Diagnostics.Debug.Assert((padChar = ' ')) + Debug.Assert((padChar = ' ')) fun (fmt: string) (w: int) (v: obj) -> GenericNumber.rightJustifyWithSpaceAsPadChar (toFormattedString fmt v) (isNumber v) (GenericNumber.isPositive v) w prefixForPositives @@ -1012,7 +1012,7 @@ module internal PrintfImpl = raise (ArgumentException(SR.GetString(SR.printfBadFormatSpecifier))) let extractCurriedArguments (ty: Type) n = - System.Diagnostics.Debug.Assert(n = 1 || n = 2 || n = 3, "n = 1 || n = 2 || n = 3") + Debug.Assert(n = 1 || n = 2 || n = 3, "n = 1 || n = 2 || n = 3") let buf = Array.zeroCreate n let rec go (ty: Type) i = if i < n then @@ -1022,7 +1022,7 @@ module internal PrintfImpl = go retTy (i + 1) | _ -> failwith (String.Format("Expected function with {0} arguments", n)) else - System.Diagnostics.Debug.Assert((i = n), "i = n") + Debug.Assert((i = n), "i = n") (buf, ty) go ty 0 @@ -1072,13 +1072,13 @@ module internal PrintfImpl = LargeStringPrintfEnv(id, blockSize) :> PrintfEnv<_,_,_> let StringBuilderPrintfEnv<'Result>(k, buf) = - { new PrintfEnv(buf) with + { new PrintfEnv(buf) with override _.Finish() : 'Result = k () override _.Write(s: string) = ignore(buf.Append s) override _.WriteT(()) = () } - let TextWriterPrintfEnv<'Result>(k, tw: IO.TextWriter) = - { new PrintfEnv(tw) with + let TextWriterPrintfEnv<'Result>(k, tw: TextWriter) = + { new PrintfEnv(tw) with override _.Finish() : 'Result = k() override _.Write(s: string) = tw.Write s override _.WriteT(()) = () } diff --git a/src/FSharp.Core/printf.fsi b/src/FSharp.Core/printf.fsi index 5bbe8405535..fbcab429d01 100644 --- a/src/FSharp.Core/printf.fsi +++ b/src/FSharp.Core/printf.fsi @@ -41,7 +41,7 @@ type PrintfFormat<'Printer, 'State, 'Residue, 'Result> = member Captures: objnull array /// The capture types associated with an interpolated string. - member CaptureTypes: System.Type array + member CaptureTypes: Type array /// Type of a formatting expression. /// diff --git a/src/FSharp.Core/quotations.fs b/src/FSharp.Core/quotations.fs index ea8b17d6f26..36d2a83411a 100644 --- a/src/FSharp.Core/quotations.fs +++ b/src/FSharp.Core/quotations.fs @@ -142,14 +142,14 @@ type Var(name: string, typ: Type, ?isMutable: bool) = override v.Equals(obj: objnull) = match obj with - | :? Var as v2 -> System.Object.ReferenceEquals(v, v2) + | :? Var as v2 -> Object.ReferenceEquals(v, v2) | _ -> false - interface System.IComparable with + interface IComparable with member v.CompareTo(obj: objnull) = match obj with | :? Var as v2 -> - if System.Object.ReferenceEquals(v, v2) then + if Object.ReferenceEquals(v, v2) then 0 else let c = compare v.Name v2.Name @@ -502,7 +502,7 @@ module Patterns = let funTyC = typeof<(obj -> obj)>.GetGenericTypeDefinition() let exprTyC = typedefof> - let voidTy = typeof + let voidTy = typeof let unitTy = typeof let removeVoid a = @@ -1032,10 +1032,10 @@ module Patterns = let mkValueWithDefn (v, ty, defn) = mkFE1 (WithValueOp(v, ty)) defn - let mkLiftedValueOpG (v, ty: System.Type) = + let mkLiftedValueOpG (v, ty: Type) = let obj = if ty.IsEnum then - System.Enum.ToObject(ty, box v) + Enum.ToObject(ty, box v) else box v @@ -1673,7 +1673,7 @@ module Patterns = { is: ByteStream istrings: string array - localAssembly: System.Reflection.Assembly + localAssembly: Assembly referencedTypeDefs: Type array } @@ -1741,10 +1741,10 @@ module Patterns = uint64 (u_int64 st) let u_double st = - System.BitConverter.ToDouble(System.BitConverter.GetBytes(u_int64 st), 0) + BitConverter.ToDouble(BitConverter.GetBytes(u_int64 st), 0) let u_float32 st = - System.BitConverter.ToSingle(System.BitConverter.GetBytes(u_int32 st), 0) + BitConverter.ToSingle(BitConverter.GetBytes(u_int32 st), 0) let u_char st = char (int32 (u_uint16 st)) @@ -1854,7 +1854,7 @@ module Patterns = let decodeNamedTy genericType tsR = mkNamedType (genericType, tsR) - let mscorlib = typeof.Assembly + let mscorlib = typeof.Assembly let u_assemblyRef st = u_string st @@ -1865,7 +1865,7 @@ module Patterns = elif a = "." then st.localAssembly else - match System.Reflection.Assembly.Load a with + match Assembly.Load a with | null -> invalidOp (String.Format(SR.GetString(SR.QfailedToBindAssembly), a.ToString())) | assembly -> assembly @@ -1874,7 +1874,7 @@ module Patterns = let mutable idx = 0 // From FSharp.Core for F# 4.0+ (4.4.0.0+), referenced type definitions can be integer indexes into a table of type definitions provided on quotation // deserialization, avoiding the need for System.Reflection.Assembly.Load - if System.Int32.TryParse(a, &idx) && b = "" then + if Int32.TryParse(a, &idx) && b = "" then st.referencedTypeDefs.[idx] else // escape commas found in type name, which are not already escaped @@ -2075,7 +2075,7 @@ module Patterns = match u_ModuleDefn None st with | Unique(StaticMethodCallOp minfo) -> (minfo :> MethodBase) | Unique(StaticPropGetOp pinfo) -> (pinfo.GetGetMethod true :> MethodBase) - | Ambiguous(_) -> raise (System.Reflection.AmbiguousMatchException()) + | Ambiguous(_) -> raise (AmbiguousMatchException()) | _ -> failwith "unreachable" | 1 -> let ((genericType, _, _, methName, _) as data) = u_MethodInfoData st @@ -2098,7 +2098,7 @@ module Patterns = | Unique(StaticMethodCallOp(minfo)) -> (minfo :> MethodBase) | Unique(StaticMethodCallWOp(_minfo, minfoW, _)) -> (minfoW :> MethodBase) | Unique(StaticPropGetOp(pinfo)) -> (pinfo.GetGetMethod(true) :> MethodBase) - | Ambiguous(_) -> raise (System.Reflection.AmbiguousMatchException()) + | Ambiguous(_) -> raise (AmbiguousMatchException()) | _ -> failwith "unreachable" | _ -> failwith "u_MethodBase" @@ -2883,7 +2883,7 @@ module DerivedPatterns = let private new_decimal_info = methodhandleof (fun (low, medium, high, isNegative, scale) -> LanguagePrimitives.IntrinsicFunctions.MakeDecimal low medium high isNegative scale) - |> System.Reflection.MethodInfo.GetMethodFromHandle + |> MethodInfo.GetMethodFromHandle :?> MethodInfo [] @@ -2901,11 +2901,11 @@ module DerivedPatterns = Expr.TryGetReflectedDefinition methodBase [] - let (|PropertyGetterWithReflectedDefinition|_|) (propertyInfo: System.Reflection.PropertyInfo) = + let (|PropertyGetterWithReflectedDefinition|_|) (propertyInfo: PropertyInfo) = Expr.TryGetReflectedDefinition(propertyInfo.GetGetMethod true) [] - let (|PropertySetterWithReflectedDefinition|_|) (propertyInfo: System.Reflection.PropertyInfo) = + let (|PropertySetterWithReflectedDefinition|_|) (propertyInfo: PropertyInfo) = Expr.TryGetReflectedDefinition(propertyInfo.GetSetMethod true) [] diff --git a/src/FSharp.Core/quotations.fsi b/src/FSharp.Core/quotations.fsi index a01ee58b914..46134946bbc 100644 --- a/src/FSharp.Core/quotations.fsi +++ b/src/FSharp.Core/quotations.fsi @@ -102,7 +102,7 @@ type Var = /// static member Global: name: string * typ: Type -> Var - interface System.IComparable + interface IComparable /// Quoted expressions annotated with System.Type values. [] diff --git a/src/FSharp.Core/reflect.fs b/src/FSharp.Core/reflect.fs index e0742b3dd06..950f791f89c 100644 --- a/src/FSharp.Core/reflect.fs +++ b/src/FSharp.Core/reflect.fs @@ -1062,7 +1062,7 @@ module internal Impl = invalidArg argName msg [] -type UnionCaseInfo(typ: System.Type, tag: int) = +type UnionCaseInfo(typ: Type, tag: int) = // Cache the tag -> name map let mutable names = None diff --git a/src/FSharp.Core/resumable.fs b/src/FSharp.Core/resumable.fs index 9e24b64bffc..77a1dffd9ac 100644 --- a/src/FSharp.Core/resumable.fs +++ b/src/FSharp.Core/resumable.fs @@ -22,7 +22,7 @@ open Microsoft.FSharp.Collections [] [] type NoEagerConstraintApplicationAttribute() = - inherit System.Attribute() + inherit Attribute() type IResumableStateMachine<'Data> = abstract ResumptionPoint: int diff --git a/src/FSharp.Core/resumable.fsi b/src/FSharp.Core/resumable.fsi index 2835b75a4dc..f5a7f7ec719 100644 --- a/src/FSharp.Core/resumable.fsi +++ b/src/FSharp.Core/resumable.fsi @@ -65,7 +65,7 @@ and ResumptionFunc<'Data> = delegate of byref> -> b type ResumableCode<'Data, 'T> = delegate of byref> -> bool /// Contains functions for composing resumable code blocks -[] +[] module ResumableCode = /// Sequences one section of resumable code after another diff --git a/src/FSharp.Core/seq.fs b/src/FSharp.Core/seq.fs index ce1bfe6d4ab..c2e21f3af9d 100644 --- a/src/FSharp.Core/seq.fs +++ b/src/FSharp.Core/seq.fs @@ -119,7 +119,7 @@ module Internal = member _.Reset() = noReset () - interface System.IDisposable with + interface IDisposable with member this.Dispose() = this.Dispose() @@ -255,7 +255,7 @@ module Internal = member _.Reset() = noReset () - interface System.IDisposable with + interface IDisposable with member _.Dispose() = e.Dispose() } @@ -284,7 +284,7 @@ module Internal = member _.Reset() = noReset () - interface System.IDisposable with + interface IDisposable with member _.Dispose() = e.Dispose() } @@ -361,7 +361,7 @@ module Internal = setIndex 0 true else - if index = System.Int32.MaxValue then + if index = Int32.MaxValue then invalidOp (SR.GetString(SR.enumerationPastIntMaxValue)) if index = finalIndex then @@ -372,7 +372,7 @@ module Internal = member _.Reset() = noReset () - interface System.IDisposable with + interface IDisposable with member _.Dispose() = () } @@ -394,7 +394,7 @@ module Internal = interface IEnumerator<'T> with member x.Current = x.Get() - interface System.Collections.IEnumerator with + interface IEnumerator with member _.MoveNext() = if curr >= len then false @@ -407,7 +407,7 @@ module Internal = member _.Reset() = noReset () - interface System.IDisposable with + interface IDisposable with member _.Dispose() = () @@ -519,7 +519,7 @@ module Internal = | Some v -> v | None -> invalidOp (SR.GetString(SR.moveNextNotCalledOrFinished)) - interface System.Collections.IEnumerator with + interface IEnumerator with member x.Current = box (x :> IEnumerator<_>).Current member x.MoveNext() = @@ -539,7 +539,7 @@ module Internal = member _.Reset() = IEnumerator.noReset () - interface System.IDisposable with + interface IDisposable with member _.Dispose() = if not finished then disposeG g @@ -570,7 +570,7 @@ module Internal = [] type CachedSeq<'T>(cleanup, res: seq<'T>) = - interface System.IDisposable with + interface IDisposable with member x.Dispose() = cleanup () @@ -578,9 +578,9 @@ type CachedSeq<'T>(cleanup, res: seq<'T>) = member x.GetEnumerator() = res.GetEnumerator() - interface System.Collections.IEnumerable with + interface IEnumerable with member x.GetEnumerator() = - (res :> System.Collections.IEnumerable).GetEnumerator() + (res :> IEnumerable).GetEnumerator() member obj.Clear() = cleanup () @@ -596,10 +596,10 @@ module Seq = mkSeq (fun () -> f().GetEnumerator()) let mkUnfoldSeq f x = - mkSeq (fun () -> IEnumerator.unfold f x) + mkSeq (fun () -> unfold f x) let inline indexNotFound () = - raise (new System.Collections.Generic.KeyNotFoundException(SR.GetString(SR.keyNotFoundAlt))) + raise (new KeyNotFoundException(SR.GetString(SR.keyNotFoundAlt))) [] let delay generator = @@ -614,14 +614,14 @@ module Seq = [] let initInfinite initializer = - mkSeq (fun () -> IEnumerator.upto None initializer) + mkSeq (fun () -> upto None initializer) [] let init count initializer = if count < 0 then invalidArgInputMustBeNonNegative "count" count - mkSeq (fun () -> IEnumerator.upto (Some(count - 1)) initializer) + mkSeq (fun () -> upto (Some(count - 1)) initializer) [] let iter action (source: seq<'T>) = @@ -639,7 +639,7 @@ module Seq = invalidArgInputMustBeNonNegative "index" index use e = source.GetEnumerator() - IEnumerator.nth index e + nth index e [] let tryItem index (source: seq<'T>) = @@ -649,7 +649,7 @@ module Seq = None else use e = source.GetEnumerator() - IEnumerator.tryItem index e + tryItem index e [] let nth index (source: seq<'T>) = @@ -736,7 +736,7 @@ module Seq = [] let filter predicate source = checkNonNull "source" source - revamp (IEnumerator.filter predicate) source + revamp (filter predicate) source [] let where predicate source = @@ -745,36 +745,36 @@ module Seq = [] let map mapping source = checkNonNull "source" source - revamp (IEnumerator.map mapping) source + revamp (map mapping) source [] let mapi mapping source = checkNonNull "source" source - revamp (IEnumerator.mapi mapping) source + revamp (mapi mapping) source [] let mapi2 mapping source1 source2 = checkNonNull "source1" source1 checkNonNull "source2" source2 - revamp2 (IEnumerator.mapi2 mapping) source1 source2 + revamp2 (mapi2 mapping) source1 source2 [] let map2 mapping source1 source2 = checkNonNull "source1" source1 checkNonNull "source2" source2 - revamp2 (IEnumerator.map2 mapping) source1 source2 + revamp2 (map2 mapping) source1 source2 [] let map3 mapping source1 source2 source3 = checkNonNull "source1" source1 checkNonNull "source2" source2 checkNonNull "source3" source3 - revamp3 (IEnumerator.map3 mapping) source1 source2 source3 + revamp3 (map3 mapping) source1 source2 source3 [] let choose chooser source = checkNonNull "source" source - revamp (IEnumerator.choose chooser) source + revamp (choose chooser) source [] let indexed source = @@ -797,7 +797,7 @@ module Seq = [] let cast (source: IEnumerable) = checkNonNull "source" source - mkSeq (fun () -> IEnumerator.cast (source.GetEnumerator())) + mkSeq (fun () -> cast (source.GetEnumerator())) [] let tryPick chooser (source: seq<'T>) = @@ -1006,7 +1006,7 @@ module Seq = [] let ofArray (source: 'T array) = checkNonNull "source" source - mkSeq (fun () -> IEnumerator.ofArray source) + mkSeq (fun () -> ofArray source) [] let toArray (source: seq<'T>) = @@ -1070,7 +1070,7 @@ module Seq = [] let singleton value = - mkSeq (fun () -> IEnumerator.Singleton value) + mkSeq (fun () -> Singleton value) [] let truncate count (source: seq<'T>) = @@ -1274,7 +1274,7 @@ module Seq = prefix.Clear() match enumeratorR with - | Some(Some e) -> IEnumerator.dispose e + | Some(Some e) -> dispose e | _ -> () enumeratorR <- None) @@ -1714,7 +1714,7 @@ module Seq = let last (source: seq<_>) = checkNonNull "source" source - match Microsoft.FSharp.Primitives.Basics.Seq.tryLastV source with + match Seq.tryLastV source with | ValueSome x -> x | ValueNone -> invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString @@ -1722,7 +1722,7 @@ module Seq = let tryLast (source: seq<_>) = checkNonNull "source" source - match Microsoft.FSharp.Primitives.Basics.Seq.tryLastV source with + match Seq.tryLastV source with | ValueSome x -> Some x | ValueNone -> None diff --git a/src/FSharp.Core/seqcore.fs b/src/FSharp.Core/seqcore.fs index 89cd432ee9a..24751a523e2 100644 --- a/src/FSharp.Core/seqcore.fs +++ b/src/FSharp.Core/seqcore.fs @@ -16,11 +16,11 @@ open Microsoft.FSharp.Collections module internal IEnumerator = - let noReset() = raise (new System.NotSupportedException(SR.GetString(SR.resetNotSupported))) - let notStarted() = raise (new System.InvalidOperationException(SR.GetString(SR.enumerationNotStarted))) - let alreadyFinished() = raise (new System.InvalidOperationException(SR.GetString(SR.enumerationAlreadyFinished))) + let noReset() = raise (new NotSupportedException(SR.GetString(SR.resetNotSupported))) + let notStarted() = raise (new InvalidOperationException(SR.GetString(SR.enumerationNotStarted))) + let alreadyFinished() = raise (new InvalidOperationException(SR.GetString(SR.enumerationAlreadyFinished))) let check started = if not started then notStarted() - let dispose (r : System.IDisposable) = r.Dispose() + let dispose (r : IDisposable) = r.Dispose() let cast (e : IEnumerator) : IEnumerator<'T> = { new IEnumerator<'T> with @@ -34,10 +34,10 @@ module internal IEnumerator = member _.Reset() = noReset() - interface System.IDisposable with + interface IDisposable with member _.Dispose() = match e with - | :? System.IDisposable as e -> e.Dispose() + | :? IDisposable as e -> e.Dispose() | _ -> () } /// A concrete implementation of an enumerator that returns no values @@ -49,7 +49,7 @@ module internal IEnumerator = check started (alreadyFinished() : 'T) - interface System.Collections.IEnumerator with + interface IEnumerator with member _.Current = check started (alreadyFinished() : obj) @@ -61,7 +61,7 @@ module internal IEnumerator = member _.Reset() = noReset() - interface System.IDisposable with + interface IDisposable with member _.Dispose() = () let Empty<'T> () = (new EmptyEnumerator<'T>() :> IEnumerator<'T>) @@ -126,7 +126,7 @@ module internal IEnumerator = member _.Reset() = noReset() - interface System.IDisposable with + interface IDisposable with member _.Dispose() = dispose() [] @@ -144,7 +144,7 @@ module internal IEnumerator = member _.Reset() = noReset() - interface System.IDisposable with + interface IDisposable with member _.Dispose() = () let Singleton x = (new Singleton<'T>(x) :> IEnumerator<'T>) @@ -161,7 +161,7 @@ module internal IEnumerator = member _.Reset() = noReset() - interface System.IDisposable with + interface IDisposable with member _.Dispose() = try e.Dispose() @@ -208,13 +208,13 @@ module RuntimeHelpers = member _.Equals(v1,v2) = gcomparer.Equals(v1.Value,v2.Value) } let Generate openf compute closef = - mkSeq (fun () -> new IEnumerator.GeneratedEnumerable<_,_>(openf, compute, closef) :> IEnumerator<'T>) + mkSeq (fun () -> new GeneratedEnumerable<_,_>(openf, compute, closef) :> IEnumerator<'T>) let EnumerateFromFunctions create moveNext current = Generate create (fun x -> if moveNext x then Some(current x) else None) - (fun x -> match box(x) with :? System.IDisposable as id -> id.Dispose() | _ -> ()) + (fun x -> match box(x) with :? IDisposable as id -> id.Dispose() | _ -> ()) // A family of enumerators that can have additional 'finally' actions added to the enumerator through // the use of mutation. This is used to 'push' the disposal action for a 'use' into the next enumerator. @@ -240,7 +240,7 @@ module RuntimeHelpers = a.AppendFinallyAction(compensation) ie | _ -> - IEnumerator.EnumerateThenFinally compensation ie + EnumerateThenFinally compensation ie with e -> compensation() reraise() @@ -251,7 +251,7 @@ module RuntimeHelpers = [] type ConcatEnumerator<'T,'U when 'U :> seq<'T>>(sources: seq<'U>) = let mutable outerEnum = sources.GetEnumerator() - let mutable currInnerEnum = IEnumerator.Empty() + let mutable currInnerEnum = Empty() let mutable started = false let mutable finished = false @@ -291,8 +291,8 @@ module RuntimeHelpers = compensations <- [] member x.GetCurrent() = - IEnumerator.check started - if finished then IEnumerator.alreadyFinished() else x.currElement + check started + if finished then alreadyFinished() else x.currElement interface IFinallyEnumerator with member _.AppendFinallyAction(f) = @@ -337,16 +337,16 @@ module RuntimeHelpers = takeOuter() takeInner () - member _.Reset() = IEnumerator.noReset() + member _.Reset() = noReset() - interface System.IDisposable with + interface IDisposable with [] member x.Dispose() = if not finished then x.Finish() - let EnumerateUsing (resource : 'T :> System.IDisposable) (source: 'T -> #seq<'U>) = + let EnumerateUsing (resource : 'T :> IDisposable) (source: 'T -> #seq<'U>) = (FinallyEnumerable((fun () -> match box resource with null -> () | _ -> resource.Dispose()), (fun () -> source resource :> seq<_>)) :> seq<_>) @@ -357,8 +357,8 @@ module RuntimeHelpers = let mutable started = false let mutable curr = None let getCurr() = - IEnumerator.check started - match curr with None -> IEnumerator.alreadyFinished() | Some x -> x + check started + match curr with None -> alreadyFinished() | Some x -> x let start() = if not started then (started <- true) let finish() = (curr <- None) @@ -379,9 +379,9 @@ module RuntimeHelpers = else finish(); false - member x.Reset() = IEnumerator.noReset() + member x.Reset() = noReset() - interface System.IDisposable with + interface IDisposable with member x.Dispose() = () })) let EnumerateThenFinally (source: seq<'T>) (compensation: unit -> unit) = @@ -440,9 +440,9 @@ module RuntimeHelpers = // We go here when either original's disposal not fail, or failed but with an unmatched exception | e when exceptionFilter e = 1 -> moveExceptionHandler(e) - member x.Reset() = IEnumerator.noReset() + member x.Reset() = noReset() - interface System.IDisposable with + interface IDisposable with member x.Dispose() = match exceptionalSource with | Some es -> es.Dispose() @@ -457,11 +457,11 @@ module RuntimeHelpers = interface IEvent<'Delegate,'Args> with member x.AddHandler(h) = addHandler h member x.RemoveHandler(h) = removeHandler h - interface System.IObservable<'Args> with + interface IObservable<'Args> with member x.Subscribe(r:IObserver<'Args>) = let h = createHandler (fun _ args -> r.OnNext(args)) addHandler h - { new System.IDisposable with + { new IDisposable with member x.Dispose() = removeHandler h } } let inline SetFreshConsTail cons tail = cons.( :: ).1 <- tail @@ -529,7 +529,7 @@ type GeneratedSequenceBase<'T>() = [] member x.MoveNext() = x.MoveNextImpl() - member _.Reset() = raise <| new System.NotSupportedException() + member _.Reset() = raise <| new NotSupportedException() [] type ListCollector<'T> = diff --git a/src/FSharp.Core/seqcore.fsi b/src/FSharp.Core/seqcore.fsi index 52b4eeb403d..02d5ead9982 100644 --- a/src/FSharp.Core/seqcore.fsi +++ b/src/FSharp.Core/seqcore.fsi @@ -18,7 +18,7 @@ module internal IEnumerator = [] type EmptyEnumerator<'T> = - interface System.IDisposable + interface IDisposable interface IEnumerator interface IEnumerator<'T> new: unit -> EmptyEnumerator<'T> @@ -34,7 +34,7 @@ module internal IEnumerator = [] type Singleton<'T> = - interface System.IDisposable + interface IDisposable interface IEnumerator interface IEnumerator<'T> new: v: 'T -> Singleton<'T> diff --git a/src/FSharp.Core/set.fs b/src/FSharp.Core/set.fs index f6ac7f99490..3f387f11140 100644 --- a/src/FSharp.Core/set.fs +++ b/src/FSharp.Core/set.fs @@ -557,7 +557,7 @@ module internal SetTree = member _.Reset() = i <- mkIterator s - interface System.IDisposable with + interface IDisposable with member _.Dispose() = () } @@ -706,11 +706,11 @@ module internal SetTree = [] type Set<[] 'T when 'T: comparison>(comparer: IComparer<'T>, tree: SetTree<'T>) = - [] + [] // NOTE: This type is logically immutable. This field is only mutated during deserialization. let mutable comparer = comparer - [] + [] // NOTE: This type is logically immutable. This field is only mutated during deserialization. let mutable tree = tree @@ -903,7 +903,7 @@ type Set<[] 'T when 'T: comparison>(comparer: IComparer<' loop () | _ -> false - interface System.IComparable with + interface IComparable with member this.CompareTo(that: objnull) = SetTree.compare this.Comparer this.Tree ((that :?> Set<'T>).Tree) @@ -936,14 +936,14 @@ type Set<[] 'T when 'T: comparison>(comparer: IComparer<' interface ICollection<'T> with member s.Add x = ignore x - raise (new System.NotSupportedException("ReadOnlyCollection")) + raise (new NotSupportedException("ReadOnlyCollection")) member s.Clear() = - raise (new System.NotSupportedException("ReadOnlyCollection")) + raise (new NotSupportedException("ReadOnlyCollection")) member s.Remove x = ignore x - raise (new System.NotSupportedException("ReadOnlyCollection")) + raise (new NotSupportedException("ReadOnlyCollection")) member s.Contains x = SetTree.mem s.Comparer x s.Tree @@ -1026,7 +1026,7 @@ and [] Set = [] - static member Create([] items: System.ReadOnlySpan<'T>) = + static member Create([] items: ReadOnlySpan<'T>) = let comparer = LanguagePrimitives.FastGenericComparer<'T> let mutable acc = SetTree.empty diff --git a/src/FSharp.Core/set.fsi b/src/FSharp.Core/set.fsi index d60432fcd0b..25a1988f4bc 100644 --- a/src/FSharp.Core/set.fsi +++ b/src/FSharp.Core/set.fsi @@ -231,7 +231,7 @@ type Set<[] 'T when 'T: comparison> = interface ICollection<'T> interface IEnumerable<'T> interface System.Collections.IEnumerable - interface System.IComparable + interface IComparable interface System.Collections.IStructuralEquatable interface IReadOnlyCollection<'T> @@ -247,7 +247,7 @@ and [A set containing the specified items. [] - static member Create: [] items: System.ReadOnlySpan<'T> -> Set<'T> + static member Create: [] items: ReadOnlySpan<'T> -> Set<'T> #endif namespace Microsoft.FSharp.Collections diff --git a/tests/FSharp.Compiler.Service.Tests/BuildGraphTests.fs b/tests/FSharp.Compiler.Service.Tests/BuildGraphTests.fs index 4769b4c322d..61140c40c33 100644 --- a/tests/FSharp.Compiler.Service.Tests/BuildGraphTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/BuildGraphTests.fs @@ -336,7 +336,7 @@ module BuildGraphTests = errorCountShouldBe 200 loggerShouldBe commonLogger - Tasks.Parallel.Invoke(task1, task2) + Parallel.Invoke(task1, task2) type internal DiagnosticsLoggerWithCallback(callback) = diff --git a/tests/FSharp.Compiler.Service.Tests/ExprTests.fs b/tests/FSharp.Compiler.Service.Tests/ExprTests.fs index eac5d3f1774..b82eb062ef2 100644 --- a/tests/FSharp.Compiler.Service.Tests/ExprTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/ExprTests.fs @@ -787,13 +787,13 @@ let ``Test Unoptimized Declarations Project1`` () = printfn "let expected2 =\n%A" (printDeclarations None (List.ofSeq file2.Declarations) |> Seq.toList) printDeclarations None (List.ofSeq file1.Declarations) |> Seq.toList - |> Utils.filterHack - |> shouldEqual (Utils.filterHack expected) + |> filterHack + |> shouldEqual (filterHack expected) printDeclarations None (List.ofSeq file2.Declarations) |> Seq.toList - |> Utils.filterHack - |> shouldEqual (Utils.filterHack expected2) + |> filterHack + |> shouldEqual (filterHack expected2) () @@ -926,13 +926,13 @@ let ``Test Optimized Declarations Project1`` () = printfn "let expected2 =\n%A" (printDeclarations None (List.ofSeq file2.Declarations) |> Seq.toList) printDeclarations None (List.ofSeq file1.Declarations) |> Seq.toList - |> Utils.filterHack - |> shouldEqual (Utils.filterHack expected) + |> filterHack + |> shouldEqual (filterHack expected) printDeclarations None (List.ofSeq file2.Declarations) |> Seq.toList - |> Utils.filterHack - |> shouldEqual (Utils.filterHack expected2) + |> filterHack + |> shouldEqual (filterHack expected2) () diff --git a/tests/FSharp.Compiler.Service.Tests/ProductVersion.fs b/tests/FSharp.Compiler.Service.Tests/ProductVersion.fs index 4808b3dff66..59f7eca4579 100644 --- a/tests/FSharp.Compiler.Service.Tests/ProductVersion.fs +++ b/tests/FSharp.Compiler.Service.Tests/ProductVersion.fs @@ -58,7 +58,7 @@ module ProductVersionTest = ComputeProductVersion (fun _ -> Some "") (ILVersionInfo(3us,2us,1us,0us)) |> Assert.shouldBe "3.2.1.0" let internal validValues () = - let max = System.UInt16.MaxValue + let max = UInt16.MaxValue [ "1.2.3.4", ILVersionInfo(1us,2us,3us,4us) "1.0.3.4", ILVersionInfo(1us,0us,3us,4us) "7.0.0.4-SomeExtraInformation", ILVersionInfo(7us,0us,0us,4us) @@ -82,7 +82,7 @@ module ProductVersionTest = "9.3", ILVersionInfo(9us,3us,0us,0us) "", ILVersionInfo(0us,0us,0us,0us) "70000.80000.90000.100000", ILVersionInfo(0us,0us,0us,0us) - (sprintf "%d.70000.80000.90000" System.UInt16.MaxValue), ILVersionInfo(System.UInt16.MaxValue,0us,0us,0us) ] + (sprintf "%d.70000.80000.90000" UInt16.MaxValue), ILVersionInfo(UInt16.MaxValue,0us,0us,0us) ] [] let ``should zero starting from first invalid version part`` () = diff --git a/tests/FSharp.Compiler.Service.Tests/SourceTextTests.fs b/tests/FSharp.Compiler.Service.Tests/SourceTextTests.fs index 50ade7ba035..3e40a2c056b 100644 --- a/tests/FSharp.Compiler.Service.Tests/SourceTextTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/SourceTextTests.fs @@ -10,7 +10,7 @@ let ``Select text from a single line via the range`` () = let sourceText = SourceText.ofString """ let a = 2 """ - let m = Range.mkRange "Sample.fs" (Position.mkPos 2 4) (Position.mkPos 2 5) + let m = mkRange "Sample.fs" (Position.mkPos 2 4) (Position.mkPos 2 5) let v = sourceText.GetSubTextFromRange m Assert.Equal("a", v) @@ -21,7 +21,7 @@ let a b c = // comment 2 """ - let m = Range.mkRange "Sample.fs" (Position.mkPos 2 4) (Position.mkPos 4 5) + let m = mkRange "Sample.fs" (Position.mkPos 2 4) (Position.mkPos 4 5) let v = sourceText.GetSubTextFromRange m let sanitized = v.Replace("\r", "") Assert.Equal("a b c =\n // comment\n 2", sanitized) @@ -29,7 +29,7 @@ let a b c = [] let ``Inconsistent return carriage return correct text`` () = let sourceText = SourceText.ofString "let a =\r\n // foo\n 43" - let m = Range.mkRange "Sample.fs" (Position.mkPos 1 4) (Position.mkPos 3 6) + let m = mkRange "Sample.fs" (Position.mkPos 1 4) (Position.mkPos 3 6) let v = sourceText.GetSubTextFromRange m let sanitized = v.Replace("\r", "") Assert.Equal("a =\n // foo\n 43", sanitized) @@ -43,5 +43,5 @@ let ``Zero range should return empty string`` () = [] let ``Invalid range should throw argument exception`` () = let sourceText = SourceText.ofString "a" - let mInvalid = Range.mkRange "Sample.fs" (Position.mkPos 3 6) (Position.mkPos 1 4) + let mInvalid = mkRange "Sample.fs" (Position.mkPos 3 6) (Position.mkPos 1 4) Assert.Throws(fun () -> sourceText.GetSubTextFromRange mInvalid |> ignore) From 13b8e1f63078b7e69608aa1084f95b99c8a75c9a Mon Sep 17 00:00:00 2001 From: Eugene Auduchinok Date: Wed, 15 Oct 2025 14:25:14 +0200 Subject: [PATCH 2/6] Cleanup: remove redundant 'new' --- src/Compiler/AbstractIL/ilwritepdb.fs | 6 +- .../Checking/PatternMatchCompilation.fs | 2 +- src/Compiler/CodeGen/EraseUnions.fs | 2 +- src/Compiler/CodeGen/IlxGen.fs | 4 +- src/Compiler/Driver/CompilerOptions.fs | 2 +- src/Compiler/TypedTree/CompilerGlobalState.fs | 2 +- src/Compiler/TypedTree/TypedTreeOps.fs | 2 +- src/Compiler/Utilities/Activity.fs | 10 +-- src/Compiler/Utilities/DependencyGraph.fs | 4 +- src/Compiler/Utilities/illib.fs | 2 +- src/FSharp.Core/Linq.fs | 6 +- src/FSharp.Core/QueryExtensions.fs | 4 +- src/FSharp.Core/array.fs | 14 ++--- src/FSharp.Core/event.fs | 2 +- src/FSharp.Core/eventmodule.fs | 18 +++--- src/FSharp.Core/local.fs | 6 +- src/FSharp.Core/mailbox.fs | 8 +-- src/FSharp.Core/map.fs | 8 +-- src/FSharp.Core/math/z.fs | 4 +- src/FSharp.Core/prim-types.fs | 62 ++++++++++--------- src/FSharp.Core/quotations.fs | 48 +++++++------- src/FSharp.Core/seq.fs | 2 +- src/FSharp.Core/seqcore.fs | 8 +-- src/FSharp.Core/set.fs | 6 +- src/FSharp.Core/string.fs | 8 +-- 25 files changed, 122 insertions(+), 118 deletions(-) diff --git a/src/Compiler/AbstractIL/ilwritepdb.fs b/src/Compiler/AbstractIL/ilwritepdb.fs index bc3dbf18adc..0b437e9e892 100644 --- a/src/Compiler/AbstractIL/ilwritepdb.fs +++ b/src/Compiler/AbstractIL/ilwritepdb.fs @@ -485,7 +485,7 @@ type PortablePdbGenerator | true, h -> h let moduleImportScopeHandle = MetadataTokens.ImportScopeHandle(1) - let importScopesTable = new Dictionary() + let importScopesTable = Dictionary() let serializeImport (writer: BlobBuilder) (import: PdbImport) = match import with @@ -561,7 +561,7 @@ type PortablePdbGenerator // writer.WriteCompressedInteger(MetadataTokens.GetHeapOffset(_debugMetadataOpt.GetOrAddBlobUTF8(import.AliasOpt))); let serializeImportsBlob (imports: PdbImport[]) = - let writer = new BlobBuilder() + let writer = BlobBuilder() for import in imports do serializeImport writer import @@ -570,7 +570,7 @@ type PortablePdbGenerator // Define the empty global imports scope for the whole assembly,it gets index #1 (the first entry in the table) let defineModuleImportScope () = - let writer = new BlobBuilder() + let writer = BlobBuilder() let blob = metadata.GetOrAddBlob writer let rid = diff --git a/src/Compiler/Checking/PatternMatchCompilation.fs b/src/Compiler/Checking/PatternMatchCompilation.fs index ea466faa5fe..ba184710ea4 100644 --- a/src/Compiler/Checking/PatternMatchCompilation.fs +++ b/src/Compiler/Checking/PatternMatchCompilation.fs @@ -992,7 +992,7 @@ let CompilePatternBasic // Add the incomplete or rethrow match clause on demand, // printing a warning if necessary (only if it is ever exercised). let mutable firstIncompleteMatchClauseWithThrowExpr = None - let warningsGenerated = new ResizeArray(2) + let warningsGenerated = ResizeArray(2) let getIncompleteMatchClause refuted = // Emit the incomplete match warning. if warnOnIncomplete then diff --git a/src/Compiler/CodeGen/EraseUnions.fs b/src/Compiler/CodeGen/EraseUnions.fs index 3d5e9e4ec91..a6fcad9aa66 100644 --- a/src/Compiler/CodeGen/EraseUnions.fs +++ b/src/Compiler/CodeGen/EraseUnions.fs @@ -1329,7 +1329,7 @@ let mkClassUnionDef |> Array.tryFindIndex (fun t -> t.IsNullary) |> Option.defaultValue -1 - let fieldsEmitted = new HashSet<_>() + let fieldsEmitted = HashSet<_>() for cidx, alt in Array.indexed cud.UnionCases do if diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index c571dc34a73..27b2687d5a1 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -220,7 +220,7 @@ let CountCallFuncInstructions = NewCounter "callfunc instructions (indirect call type IlxGenIntraAssemblyInfo(staticFieldInfo: ConcurrentDictionary) = static member Create() = - new IlxGenIntraAssemblyInfo(new ConcurrentDictionary<_, _>(HashIdentity.Structural)) + IlxGenIntraAssemblyInfo(ConcurrentDictionary<_, _>(HashIdentity.Structural)) member _.GetOrAddStaticFieldInfo(info: ILMethodRef, f: System.Func) = staticFieldInfo.GetOrAdd(info, f) @@ -2326,7 +2326,7 @@ and AssemblyBuilder(cenv: cenv, anonTypeTable: AnonTypeGenerationTable) as mgbuf // The definitions of top level values, as quotations let reflectedDefinitions = - new StampedDictionary(HashIdentity.Reference) + StampedDictionary(HashIdentity.Reference) // A memoization table for generating value types for big constant arrays let rawDataValueTypeGenerator = diff --git a/src/Compiler/Driver/CompilerOptions.fs b/src/Compiler/Driver/CompilerOptions.fs index 6440607f4b5..a841c7da0e6 100644 --- a/src/Compiler/Driver/CompilerOptions.fs +++ b/src/Compiler/Driver/CompilerOptions.fs @@ -172,7 +172,7 @@ let getPublicOptions heading opts width = + (opts |> List.map (fun t -> getCompilerOption t width) |> String.concat "") let GetCompilerOptionBlocks blocks width = - let sb = new StringBuilder() + let sb = StringBuilder() let publicBlocks = blocks diff --git a/src/Compiler/TypedTree/CompilerGlobalState.fs b/src/Compiler/TypedTree/CompilerGlobalState.fs index 44f4548e501..ac83f077ae7 100644 --- a/src/Compiler/TypedTree/CompilerGlobalState.fs +++ b/src/Compiler/TypedTree/CompilerGlobalState.fs @@ -40,7 +40,7 @@ type NiceNameGenerator() = type StableNiceNameGenerator() = let niceNames = ConcurrentDictionary(max Environment.ProcessorCount 1, 127) - let innerGenerator = new NiceNameGenerator() + let innerGenerator = NiceNameGenerator() member x.GetUniqueCompilerGeneratedName (name, m: range, uniq) = let basicName = GetBasicNameOfPossibleCompilerGeneratedName name diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 8b6cb85d058..0bfc1e35bb1 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -9465,7 +9465,7 @@ let mkIsInstConditional g m tgtTy vinputExpr v e2 e3 = (* match inp with DU(_) -> true | _ -> false *) let mkUnionCaseTest (g: TcGlobals) (e1, cref: UnionCaseRef, tinst, m) = - let mbuilder = new MatchBuilder(DebugPointAtBinding.NoneAtInvisible, m) + let mbuilder = MatchBuilder(DebugPointAtBinding.NoneAtInvisible, m) let tg2 = mbuilder.AddResultTarget(Expr.Const(Const.Bool true, m, g.bool_ty)) let tg3 = mbuilder.AddResultTarget(Expr.Const(Const.Bool false, m, g.bool_ty)) let dtree = TDSwitch(e1, [TCase(DecisionTreeTest.UnionCase(cref, tinst), tg2)], Some tg3, m) diff --git a/src/Compiler/Utilities/Activity.fs b/src/Compiler/Utilities/Activity.fs index 1995e94ad6b..6b1a5754436 100644 --- a/src/Compiler/Utilities/Activity.fs +++ b/src/Compiler/Utilities/Activity.fs @@ -155,7 +155,7 @@ module internal Activity = | null -> () | activity when activity.Source = activitySource -> let collection = tags |> Seq.map KeyValuePair |> ActivityTagsCollection - let event = new ActivityEvent(name, tags = collection) + let event = ActivityEvent(name, tags = collection) activity.AddEvent event |> ignore | _ -> () @@ -226,7 +226,7 @@ module internal Activity = ActivityStopped = (fun a -> Console.Write('|') - let indentedName = new String('>', a.Depth) + a.DisplayName + let indentedName = String('>', a.Depth) + a.DisplayName Console.Write(indentedName.PadRight(nameColumnWidth)) let elapsed = (a.StartTimeUtc + a.Duration - reportingStart).TotalSeconds @@ -238,7 +238,7 @@ module internal Activity = Console.WriteLine()) ) - Console.WriteLine(new String('-', header.Length)) + Console.WriteLine(String('-', header.Length)) Console.WriteLine(header) Console.WriteLine(header |> String.map (fun c -> if c = '|' then c else '-')) @@ -248,7 +248,7 @@ module internal Activity = member this.Dispose() = statsMeasurementListener.Dispose() consoleWriterListener.Dispose() - Console.WriteLine(new String('-', header.Length)) + Console.WriteLine(String('-', header.Length)) } module CsvExport = @@ -274,7 +274,7 @@ module internal Activity = txtVal let private createCsvRow (a: Activity) = - let sb = new StringBuilder(128) + let sb = StringBuilder(128) let appendWithLeadingComma (s: string MaybeNull) = sb.Append(',') |> ignore diff --git a/src/Compiler/Utilities/DependencyGraph.fs b/src/Compiler/Utilities/DependencyGraph.fs index 1156018e994..f36e8ac29d4 100644 --- a/src/Compiler/Utilities/DependencyGraph.fs +++ b/src/Compiler/Utilities/DependencyGraph.fs @@ -351,8 +351,8 @@ type GraphExtensions = [] static member UnpackOneMany(dependencies: 'NodeValue seq, oneUnpacker, manyUnpacker) = let mutable oneResult = None - let manyResult = new ResizeArray<_>() - let extras = new ResizeArray<_>() + let manyResult = ResizeArray<_>() + let extras = ResizeArray<_>() for dependency in dependencies do match oneUnpacker dependency, manyUnpacker dependency with diff --git a/src/Compiler/Utilities/illib.fs b/src/Compiler/Utilities/illib.fs index e10a84f8ea7..b4aec4f0393 100644 --- a/src/Compiler/Utilities/illib.fs +++ b/src/Compiler/Utilities/illib.fs @@ -970,7 +970,7 @@ type MemoizationTable<'T, 'U when 'T: not null>(name, compute: 'T -> 'U, keyComp /// A thread-safe lookup table which is assigning an auto-increment stamp with each insert type internal StampedDictionary<'T, 'U when 'T: not null>(keyComparer: IEqualityComparer<'T>) = - let table = new ConcurrentDictionary<'T, Lazy>(keyComparer) + let table = ConcurrentDictionary<'T, Lazy>(keyComparer) let mutable count = -1 member _.Add(key, value) = diff --git a/src/FSharp.Core/Linq.fs b/src/FSharp.Core/Linq.fs index 505aabf2517..06b84cd98d3 100644 --- a/src/FSharp.Core/Linq.fs +++ b/src/FSharp.Core/Linq.fs @@ -562,7 +562,7 @@ module LeafExpressionConverter = // Detect the F# quotation encoding of decimal literals | MakeDecimalQ (_, _, [Int32 lo; Int32 med; Int32 hi; Bool isNegative; Byte scale]) -> - Expression.Constant (new System.Decimal(lo, med, hi, isNegative, scale)) |> asExpr + Expression.Constant (System.Decimal(lo, med, hi, isNegative, scale)) |> asExpr | NegQ (_, _, [x]) -> transUnaryOp isLinqExpressionsArithmeticTypeButNotUnsignedInt inp env x Expression.Negate (methodhandleof (LanguagePrimitives.UnaryNegationDynamic)) | PlusQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env false x1 x2 false Expression.Add (methodhandleof (fun (x, y) -> LanguagePrimitives.AdditionDynamic x y)) @@ -793,7 +793,9 @@ module LeafExpressionConverter = failConvert inp and failConvert inp = - raise (new NotSupportedException(Printf.sprintf "Could not convert the following F# Quotation to a LINQ Expression Tree\n--------\n%s\n-------------\n" (inp.ToString()))) + raise ( + NotSupportedException(Printf.sprintf "Could not convert the following F# Quotation to a LINQ Expression Tree\n--------\n%s\n-------------\n" (inp.ToString())) + ) /// Translate a unary operator and transUnaryOp linqExpressionsCondition inp env x (exprErasedConstructor: _ * _ -> _) fallback = diff --git a/src/FSharp.Core/QueryExtensions.fs b/src/FSharp.Core/QueryExtensions.fs index 4b94e239fcb..b6a682d0389 100644 --- a/src/FSharp.Core/QueryExtensions.fs +++ b/src/FSharp.Core/QueryExtensions.fs @@ -112,7 +112,7 @@ module internal Adapters = let anonObjectTypes = tupleTypes |> Array.map snd let tupleToAnonTypeMap = - let t = new Dictionary() + let t = Dictionary() for (k, v) in tupleTypes do t.[k] <- v @@ -120,7 +120,7 @@ module internal Adapters = t let anonToTupleTypeMap = - let t = new Dictionary() + let t = Dictionary() for (k, v) in tupleTypes do t.[v] <- k diff --git a/src/FSharp.Core/array.fs b/src/FSharp.Core/array.fs index e0120183de8..2c6dc792572 100644 --- a/src/FSharp.Core/array.fs +++ b/src/FSharp.Core/array.fs @@ -2460,13 +2460,13 @@ module Array = (array: 'T array) = let counts = - new ConcurrentDictionary<_, _>( + ConcurrentDictionary<_, _>( concurrencyLevel = maxPartitions, capacity = Operators.min (array.Length) 1_000, comparer = comparer - ) + ) - let valueFactory = new Func<_, _>(fun _ -> ref 0) + let valueFactory = Func<_, _>(fun _ -> ref 0) let projectedValues = Microsoft.FSharp.Primitives.Basics.Array.zeroCreateUnchecked array.Length @@ -2493,7 +2493,7 @@ module Array = let mutable finalIdx = 0 let finalResultsLookup = - new Dictionary<'SafeKey, int ref * 'T array>(capacity = counts.Count, comparer = comparer) + Dictionary<'SafeKey, int ref * 'T array>(capacity = counts.Count, comparer = comparer) for kvp in counts do let arrayForThisGroup = @@ -2678,8 +2678,8 @@ module Array = while cmpWithPivot rightIdx <= 0 && rightIdx < lastIdx do rightIdx <- rightIdx + 1 - new ArraySegment<_>(orig.Array, offset = orig.Offset, count = leftIdx - orig.Offset + 1), - new ArraySegment<_>(orig.Array, offset = rightIdx, count = lastIdx - rightIdx + 1) + ArraySegment<_>(orig.Array, offset = orig.Offset, count = leftIdx - orig.Offset + 1), + ArraySegment<_>(orig.Array, offset = rightIdx, count = lastIdx - rightIdx + 1) let partitionIntoTwoUsingComparer (cmp: 'T -> 'T -> int) @@ -2745,7 +2745,7 @@ module Array = sortChunk right (freeWorkers - workersForLeftTask) leftTask.Wait() - let bigSegment = new ArraySegment<_>(array, 0, array.Length) + let bigSegment = ArraySegment<_>(array, 0, array.Length) sortChunk bigSegment maxPartitions let sortInPlaceWithHelper diff --git a/src/FSharp.Core/event.fs b/src/FSharp.Core/event.fs index db2bb0664b9..999327c2e0e 100644 --- a/src/FSharp.Core/event.fs +++ b/src/FSharp.Core/event.fs @@ -186,7 +186,7 @@ type Event<'T> = Atomic.setWith (fun value -> Delegate.Remove(value, d) :?> Handler<'T>) &x.multicast interface IObservable<'T> with member e.Subscribe(observer) = - let h = new Handler<_>(fun sender args -> observer.OnNext(args)) + let h = Handler<_>(fun sender args -> observer.OnNext(args)) (e :?> IEvent<_, _>).AddHandler(h) { new IDisposable with diff --git a/src/FSharp.Core/eventmodule.fs b/src/FSharp.Core/eventmodule.fs index 74078c6bafb..d857109877f 100644 --- a/src/FSharp.Core/eventmodule.fs +++ b/src/FSharp.Core/eventmodule.fs @@ -11,13 +11,13 @@ module Event = [] let map mapping (sourceEvent: IEvent<'Delegate, 'T>) = - let ev = new Event<_>() + let ev = Event<_>() sourceEvent.Add(mapping >> ev.Trigger) ev.Publish [] let filter predicate (sourceEvent: IEvent<'Delegate, 'T>) = - let ev = new Event<_>() + let ev = Event<_>() sourceEvent.Add(fun x -> if predicate x then @@ -27,8 +27,8 @@ module Event = [] let partition predicate (sourceEvent: IEvent<'Delegate, 'T>) = - let ev1 = new Event<_>() - let ev2 = new Event<_>() + let ev1 = Event<_>() + let ev2 = Event<_>() sourceEvent.Add(fun x -> if predicate x then @@ -40,7 +40,7 @@ module Event = [] let choose chooser (sourceEvent: IEvent<'Delegate, 'T>) = - let ev = new Event<_>() + let ev = Event<_>() sourceEvent.Add(fun x -> match chooser x with @@ -52,7 +52,7 @@ module Event = [] let scan collector state (sourceEvent: IEvent<'Delegate, 'T>) = let mutable state = state - let ev = new Event<_>() + let ev = Event<_>() sourceEvent.Add(fun msg -> let z = state @@ -82,15 +82,15 @@ module Event = [] let merge (event1: IEvent<'Del1, 'T>) (event2: IEvent<'Del2, 'T>) = - let ev = new Event<_>() + let ev = Event<_>() event1.Add(fun x -> ev.Trigger(x)) event2.Add(fun x -> ev.Trigger(x)) ev.Publish [] let split (splitter: 'T -> Choice<'U1, 'U2>) (sourceEvent: IEvent<'Delegate, 'T>) = - let ev1 = new Event<_>() - let ev2 = new Event<_>() + let ev1 = Event<_>() + let ev2 = Event<_>() sourceEvent.Add(fun x -> match splitter x with diff --git a/src/FSharp.Core/local.fs b/src/FSharp.Core/local.fs index e79003b4d98..faf590bb5b8 100644 --- a/src/FSharp.Core/local.fs +++ b/src/FSharp.Core/local.fs @@ -12,17 +12,17 @@ module internal DetailedExceptions = /// takes an argument, a formatting string, a param array to splice into the formatting string let inline invalidArgFmt (arg:string) (format:string) paramArray = let msg = String.Format (format, paramArray) - raise (new ArgumentException (msg, arg)) + raise (ArgumentException(msg, arg)) /// takes an argument, a formatting string, a param array to splice into the formatting string let inline invalidArgOutOfRangeFmt (arg:string) (format:string) paramArray = let msg = String.Format (format, paramArray) - raise (new ArgumentOutOfRangeException (arg, msg)) + raise (ArgumentOutOfRangeException(arg, msg)) /// takes a formatting string and a param array to splice into the formatting string let inline invalidOpFmt (format:string) paramArray = let msg = String.Format (format, paramArray) - raise (new InvalidOperationException(msg)) + raise (InvalidOperationException(msg)) /// throws an invalid argument exception and returns the difference between the lists' lengths let invalidArgDifferentListLength (arg1:string) (arg2:string) (diff:int) = diff --git a/src/FSharp.Core/mailbox.fs b/src/FSharp.Core/mailbox.fs index ee03db1c8d3..cc18804b5fb 100644 --- a/src/FSharp.Core/mailbox.fs +++ b/src/FSharp.Core/mailbox.fs @@ -369,7 +369,7 @@ type MailboxProcessor<'Msg>(body, isThrowExceptionAfterDisposed, ?cancellationTo let mutable defaultTimeout = Timeout.Infinite let mutable started = false - let errorEvent = new Event() + let errorEvent = Event() new(body, ?cancellationToken: CancellationToken) = match cancellationToken with @@ -394,7 +394,7 @@ type MailboxProcessor<'Msg>(body, isThrowExceptionAfterDisposed, ?cancellationTo /// marked as started in this method, be sure to subsequently start the agent after calling this method. member private x.PrepareToStart() = if started then - raise (new InvalidOperationException(SR.GetString(SR.mailboxProcessorAlreadyStarted))) + raise (InvalidOperationException(SR.GetString(SR.mailboxProcessorAlreadyStarted))) else started <- true @@ -425,7 +425,7 @@ type MailboxProcessor<'Msg>(body, isThrowExceptionAfterDisposed, ?cancellationTo let msg = buildMessage ( - new AsyncReplyChannel<_>(fun reply -> + AsyncReplyChannel<_>(fun reply -> // Note the ResultCell may have been disposed if the operation // timed out. In this case RegisterResult drops the result on the floor. resultCell.RegisterResult(reply, reuseThread = false) |> ignore) @@ -445,7 +445,7 @@ type MailboxProcessor<'Msg>(body, isThrowExceptionAfterDisposed, ?cancellationTo let msg = buildMessage ( - new AsyncReplyChannel<_>(fun reply -> + AsyncReplyChannel<_>(fun reply -> // Note the ResultCell may have been disposed if the operation // timed out. In this case RegisterResult drops the result on the floor. resultCell.RegisterResult(reply, reuseThread = false) |> ignore) diff --git a/src/FSharp.Core/map.fs b/src/FSharp.Core/map.fs index 2fd80f177e5..36e3aa3bf72 100644 --- a/src/FSharp.Core/map.fs +++ b/src/FSharp.Core/map.fs @@ -727,11 +727,11 @@ type Map<[] 'Key, [) : Map<'Key, 'Value> = let comparer = LanguagePrimitives.FastGenericComparer<'Key> - new Map<_, _>(comparer, MapTree.ofSeq comparer ie) + Map<_, _>(comparer, MapTree.ofSeq comparer ie) new(elements: seq<_>) = let comparer = LanguagePrimitives.FastGenericComparer<'Key> - new Map<_, _>(comparer, MapTree.ofSeq comparer elements) + Map<_, _>(comparer, MapTree.ofSeq comparer elements) [] member internal m.Comparer = comparer @@ -837,7 +837,7 @@ type Map<[] 'Key, [ = let comparer = LanguagePrimitives.FastGenericComparer<'Key> - new Map<_, _>(comparer, MapTree.ofList comparer l) + Map<_, _>(comparer, MapTree.ofList comparer l) member this.ComputeHashCode() = let combineHash x y = @@ -1256,7 +1256,7 @@ module Map = [] let ofArray (elements: ('Key * 'Value) array) = let comparer = LanguagePrimitives.FastGenericComparer<'Key> - new Map<_, _>(comparer, MapTree.ofArray comparer elements) + Map<_, _>(comparer, MapTree.ofArray comparer elements) [] let toList (table: Map<_, _>) = diff --git a/src/FSharp.Core/math/z.fs b/src/FSharp.Core/math/z.fs index a443ce64e64..bb84950492d 100644 --- a/src/FSharp.Core/math/z.fs +++ b/src/FSharp.Core/math/z.fs @@ -28,8 +28,8 @@ module NumericLiterals = module NumericLiteralI = - let tab64 = new System.Collections.Generic.Dictionary() - let tabParse = new System.Collections.Generic.Dictionary() + let tab64 = System.Collections.Generic.Dictionary() + let tabParse = System.Collections.Generic.Dictionary() let FromInt64Dynamic (value: int64) : objnull = lock tab64 (fun () -> diff --git a/src/FSharp.Core/prim-types.fs b/src/FSharp.Core/prim-types.fs index 7e30997a842..e884728d51e 100644 --- a/src/FSharp.Core/prim-types.fs +++ b/src/FSharp.Core/prim-types.fs @@ -61,8 +61,8 @@ namespace Microsoft.FSharp.Core type SealedAttribute(value:bool) = inherit Attribute() member _.Value = value - new() = new SealedAttribute(true) - + new() = SealedAttribute(true) + [] [] type AbstractClassAttribute() = @@ -83,8 +83,8 @@ namespace Microsoft.FSharp.Core type AllowNullLiteralAttribute(value: bool) = inherit Attribute() member _.Value = value - new () = new AllowNullLiteralAttribute(true) - + new () = AllowNullLiteralAttribute(true) + [] [] type VolatileFieldAttribute() = @@ -117,7 +117,7 @@ namespace Microsoft.FSharp.Core type DefaultValueAttribute(check:bool) = inherit Attribute() member _.Check = check - new() = new DefaultValueAttribute(true) + new() = DefaultValueAttribute(true) [] [] @@ -665,13 +665,13 @@ namespace Microsoft.FSharp.Core [] let inline (~&) (obj : 'T) : byref<'T> = ignore obj // pretend the variable is used - let e = new ArgumentException(ErrorStrings.AddressOpNotFirstClassString) + let e = ArgumentException(ErrorStrings.AddressOpNotFirstClassString) (# "throw" (e :> System.Exception) : byref<'T> #) [] let inline (~&&) (obj : 'T) : nativeptr<'T> = ignore obj // pretend the variable is used - let e = new ArgumentException(ErrorStrings.AddressOpNotFirstClassString) + let e = ArgumentException(ErrorStrings.AddressOpNotFirstClassString) (# "throw" (e :> System.Exception) : nativeptr<'T> #) open IntrinsicOperators @@ -934,8 +934,8 @@ namespace Microsoft.FSharp.Core if (System.Threading.Interlocked.CompareExchange(&(x.nodeCount), sz, 0) = 0) then x else - new CountLimitedHasherPER(sz) - + CountLimitedHasherPER(sz) + interface IEqualityComparer /// The implementation of IEqualityComparer, using unlimited depth for hashing and ER semantics for NaN equality. @@ -1069,7 +1069,7 @@ namespace Microsoft.FSharp.Core //------------------------------------------------------------------------- let FailGenericComparison (obj: obj) = - raise (new ArgumentException(String.Format(SR.GetString(SR.genericCompareFail1), obj.GetType().ToString()))) + raise (ArgumentException(String.Format(SR.GetString(SR.genericCompareFail1), obj.GetType().ToString()))) /// This type has two instances - fsComparerER and fsComparerThrow. @@ -1081,8 +1081,8 @@ namespace Microsoft.FSharp.Core /// The unique exception object that is thrown locally when NaNs are compared in PER mode (by fsComparerPER) /// This exception should never be observed by user code. - let NaNException = new Exception() - + let NaNException = Exception() + /// Implements generic comparison between two objects. This corresponds to the pseudo-code in the F# /// specification. The treatment of NaNs is governed by "comp". let rec GenericCompare (comp:GenericComparer) (xobj:objnull, yobj:objnull) = @@ -2538,7 +2538,7 @@ namespace Microsoft.FSharp.Core let inline UIntPtrWithMeasure (f : unativeint) : unativeint<'Measure> = retype f - let inline formatError() = raise (new FormatException(SR.GetString(SR.badFormatString))) + let inline formatError() = raise (FormatException(SR.GetString(SR.badFormatString))) // Parse formats // DDDDDDDD @@ -2591,7 +2591,7 @@ namespace Microsoft.FSharp.Core let ParseUInt32 (s:string) = if Object.ReferenceEquals(s,null) then - raise( new ArgumentNullException("s") ) + raise(ArgumentNullException("s")) let s = removeUnderscores (s.Trim()) let l = s.Length let mutable p = 0 @@ -2608,7 +2608,7 @@ namespace Microsoft.FSharp.Core let ParseInt32 (s:string) = if Object.ReferenceEquals(s,null) then - raise( new ArgumentNullException("s") ) + raise(ArgumentNullException("s")) let s = removeUnderscores (s.Trim()) let l = s.Length let mutable p = 0 @@ -2623,7 +2623,7 @@ namespace Microsoft.FSharp.Core let ParseInt64 (s:string) = if Object.ReferenceEquals(s,null) then - raise( new ArgumentNullException("s") ) + raise(ArgumentNullException("s")) let s = removeUnderscores (s.Trim()) let l = s.Length let mutable p = 0 @@ -2638,7 +2638,7 @@ namespace Microsoft.FSharp.Core let ParseUInt64 (s:string) : uint64 = if Object.ReferenceEquals(s,null) then - raise( new ArgumentNullException("s") ) + raise(ArgumentNullException("s")) let s = removeUnderscores (s.Trim()) let l = s.Length let mutable p = 0 @@ -4033,7 +4033,7 @@ namespace Microsoft.FSharp.Core | Some : Value:'T -> 'T option [] - member x.Value = match x with Some x -> x | None -> raise (new InvalidOperationException("Option.Value")) + member x.Value = match x with Some x -> x | None -> raise (InvalidOperationException("Option.Value")) [] member x.IsNone = match x with None -> true | _ -> false @@ -4074,7 +4074,9 @@ namespace Microsoft.FSharp.Core | ValueNone : 'T voption | ValueSome : Item: 'T -> 'T voption - member x.Value = match x with ValueSome x -> x | ValueNone -> raise (new InvalidOperationException("ValueOption.Value")) + member x.Value = match x with ValueSome x -> x | ValueNone -> raise ( + InvalidOperationException("ValueOption.Value") + ) [] static member None : 'T voption = ValueNone @@ -4217,9 +4219,9 @@ namespace Microsoft.FSharp.Collections module PrivateListHelpers = - let notStarted() = raise (new InvalidOperationException(SR.GetString(SR.enumerationNotStarted))) + let notStarted() = raise (InvalidOperationException(SR.GetString(SR.enumerationNotStarted))) - let alreadyFinished() = raise (new InvalidOperationException(SR.GetString(SR.enumerationAlreadyFinished))) + let alreadyFinished() = raise (InvalidOperationException(SR.GetString(SR.enumerationAlreadyFinished))) let outOfRange() = raise (IndexOutOfRangeException(SR.GetString(SR.indexOutOfBounds))) @@ -4282,9 +4284,9 @@ namespace Microsoft.FSharp.Collections let rec nth l n = match l with - | [] -> raise (new ArgumentException(SR.GetString(SR.indexOutOfBounds),"n")) + | [] -> raise (ArgumentException(SR.GetString(SR.indexOutOfBounds),"n")) | h :: t -> - if n < 0 then raise (new ArgumentException((SR.GetString(SR.inputMustBeNonNegative)),"n")) + if n < 0 then raise (ArgumentException((SR.GetString(SR.inputMustBeNonNegative)),"n")) elif n = 0 then h else nth t (n - 1) @@ -4480,15 +4482,15 @@ namespace Microsoft.FSharp.Core [] let inline nullArgCheck (argumentName:string) (value: 'T | null when 'T : not null and 'T : not struct) = match value with - | null -> raise (new ArgumentNullException(argumentName)) + | null -> raise (ArgumentNullException(argumentName)) | _ -> (# "" value : 'T #) [] let inline raise (exn: exn) = (# "throw" exn : 'T #) - let Failure message = new Exception(message) - + let Failure message = Exception(message) + [] let (|Failure|_|) (error: exn) = if Type.op_Equality(error.GetType(), typeof) then Some error.Message else None @@ -4518,11 +4520,11 @@ namespace Microsoft.FSharp.Core [] let inline invalidArg (argumentName:string) (message:string) = - raise (new ArgumentException(message,argumentName)) + raise (ArgumentException(message,argumentName)) [] let inline nullArg (argumentName:string) = - raise (new ArgumentNullException(argumentName)) + raise (ArgumentNullException(argumentName)) [] let inline invalidOp message = raise (InvalidOperationException(message)) @@ -5866,8 +5868,8 @@ namespace Microsoft.FSharp.Core open System.Collections - let notStarted() = raise (new InvalidOperationException(SR.GetString(SR.enumerationNotStarted))) - let alreadyFinished() = raise (new InvalidOperationException(SR.GetString(SR.enumerationAlreadyFinished))) + let notStarted() = raise (InvalidOperationException(SR.GetString(SR.enumerationNotStarted))) + let alreadyFinished() = raise (InvalidOperationException(SR.GetString(SR.enumerationAlreadyFinished))) // Notes on "inline" with range ienumerable generation. // "inline" is used to ensure that primitive ops like add,sub etc. are direct calls. diff --git a/src/FSharp.Core/quotations.fs b/src/FSharp.Core/quotations.fs index 36d2a83411a..1d7e0c91024 100644 --- a/src/FSharp.Core/quotations.fs +++ b/src/FSharp.Core/quotations.fs @@ -106,7 +106,7 @@ type Var(name: string, typ: Type, ?isMutable: bool) = let mutable lastStamp = -1L // first value retrieved will be 0 fun () -> System.Threading.Interlocked.Increment &lastStamp - static let globals = new Dictionary<(string * Type), Var>(11) + static let globals = Dictionary<(string * Type), Var>(11) let stamp = getStamp () let isMutable = defaultArg isMutable false @@ -130,7 +130,7 @@ type Var(name: string, typ: Type, ?isMutable: bool) = if ok then res else - let res = new Var(name, typ) + let res = Var(name, typ) globals.[(name, typ)] <- res res) @@ -483,10 +483,10 @@ module Patterns = res let E t = - new Expr(t, []) + Expr(t, []) let EA (t, attribs) = - new Expr(t, attribs) + Expr(t, attribs) let (|E|) (e: Expr) = e.Tree @@ -1131,7 +1131,7 @@ module Patterns = // Discriminated unions let mkNewUnionCase (unionCase: UnionCaseInfo, args: Expr list) = if Unchecked.defaultof = unionCase then - raise (new ArgumentNullException()) + raise (ArgumentNullException()) let sargs = unionCase.GetFields() @@ -1148,7 +1148,7 @@ module Patterns = let mkUnionCaseTest (unionCase: UnionCaseInfo, expr) = if Unchecked.defaultof = unionCase then - raise (new ArgumentNullException()) + raise (ArgumentNullException()) checkTypesSR unionCase.DeclaringType (typeOf expr) "UnionCaseTagTest" (SR.GetString(SR.QtmmExprTypeMismatch)) mkFE1 (UnionCaseTestOp unionCase) expr @@ -1165,7 +1165,7 @@ module Patterns = let mkInstanceFieldGet (obj, finfo: FieldInfo) = if Unchecked.defaultof = finfo then - raise (new ArgumentNullException()) + raise (ArgumentNullException()) match finfo.IsStatic with | false -> @@ -1175,7 +1175,7 @@ module Patterns = let mkStaticFieldGet (finfo: FieldInfo) = if Unchecked.defaultof = finfo then - raise (new ArgumentNullException()) + raise (ArgumentNullException()) match finfo.IsStatic with | true -> mkFE0 (StaticFieldGetOp finfo) @@ -1183,7 +1183,7 @@ module Patterns = let mkStaticFieldSet (finfo: FieldInfo, value: Expr) = if Unchecked.defaultof = finfo then - raise (new ArgumentNullException()) + raise (ArgumentNullException()) checkTypesSR (typeOf value) finfo.FieldType "value" (SR.GetString(SR.QtmmBadFieldType)) @@ -1193,7 +1193,7 @@ module Patterns = let mkInstanceFieldSet (obj, finfo: FieldInfo, value: Expr) = if Unchecked.defaultof = finfo then - raise (new ArgumentNullException()) + raise (ArgumentNullException()) checkTypesSR (typeOf value) finfo.FieldType "value" (SR.GetString(SR.QtmmBadFieldType)) @@ -1205,7 +1205,7 @@ module Patterns = let mkCtorCall (ci: ConstructorInfo, args: Expr list) = if Unchecked.defaultof = ci then - raise (new ArgumentNullException()) + raise (ArgumentNullException()) checkArgs (ci.GetParameters()) args mkFEN (NewObjectOp ci) args @@ -1215,7 +1215,7 @@ module Patterns = let mkStaticPropGet (pinfo: PropertyInfo, args: Expr list) = if Unchecked.defaultof = pinfo then - raise (new ArgumentNullException()) + raise (ArgumentNullException()) if (not pinfo.CanRead) then invalidArg "pinfo" (SR.GetString(SR.QreadingSetOnly)) @@ -1228,7 +1228,7 @@ module Patterns = let mkInstancePropGet (obj, pinfo: PropertyInfo, args: Expr list) = if Unchecked.defaultof = pinfo then - raise (new ArgumentNullException()) + raise (ArgumentNullException()) if (not pinfo.CanRead) then invalidArg "pinfo" (SR.GetString(SR.QreadingSetOnly)) @@ -1243,7 +1243,7 @@ module Patterns = let mkStaticPropSet (pinfo: PropertyInfo, args: Expr list, value: Expr) = if Unchecked.defaultof = pinfo then - raise (new ArgumentNullException()) + raise (ArgumentNullException()) if (not pinfo.CanWrite) then invalidArg "pinfo" (SR.GetString(SR.QwritingGetOnly)) @@ -1256,7 +1256,7 @@ module Patterns = let mkInstancePropSet (obj, pinfo: PropertyInfo, args: Expr list, value: Expr) = if Unchecked.defaultof = pinfo then - raise (new ArgumentNullException()) + raise (ArgumentNullException()) if (not pinfo.CanWrite) then invalidArg "pinfo" (SR.GetString(SR.QwritingGetOnly)) @@ -1271,7 +1271,7 @@ module Patterns = let mkInstanceMethodCall (obj, minfo: MethodInfo, args: Expr list) = if Unchecked.defaultof = minfo then - raise (new ArgumentNullException()) + raise (ArgumentNullException()) checkArgs (minfo.GetParameters()) args @@ -1283,7 +1283,7 @@ module Patterns = let mkInstanceMethodCallW (obj, minfo: MethodInfo, minfoW: MethodInfo, nWitnesses: int, args: Expr list) = if Unchecked.defaultof = minfo then - raise (new ArgumentNullException()) + raise (ArgumentNullException()) checkArgs (minfoW.GetParameters()) args @@ -1295,7 +1295,7 @@ module Patterns = let mkStaticMethodCall (minfo: MethodInfo, args: Expr list) = if Unchecked.defaultof = minfo then - raise (new ArgumentNullException()) + raise (ArgumentNullException()) checkArgs (minfo.GetParameters()) args @@ -1305,7 +1305,7 @@ module Patterns = let mkStaticMethodCallW (minfo: MethodInfo, minfoW: MethodInfo, nWitnesses: int, args: Expr list) = if Unchecked.defaultof = minfo then - raise (new ArgumentNullException()) + raise (ArgumentNullException()) checkArgs (minfoW.GetParameters()) args @@ -1586,7 +1586,7 @@ module Patterns = let inline checkNonNullResult (arg: string, err: string) y = match box y with - | null -> raise (new ArgumentNullException(arg, err)) + | null -> raise (ArgumentNullException(arg, err)) | _ -> y let inst (tyargs: Type list) (i: Instantiable<'T>) = @@ -1801,7 +1801,7 @@ module Patterns = let phase2data = let st2 = { - is = new ByteStream(phase2bytes, 0, phase2bytes.Length) + is = ByteStream(phase2bytes, 0, phase2bytes.Length) istrings = [||] localAssembly = localAssembly referencedTypeDefs = referencedTypeDefs @@ -1813,7 +1813,7 @@ module Patterns = let st1 = { - is = new ByteStream(phase1bytes, 0, phase1bytes.Length) + is = ByteStream(phase1bytes, 0, phase1bytes.Length) istrings = Array.ofList stringTab localAssembly = localAssembly referencedTypeDefs = referencedTypeDefs @@ -2334,7 +2334,7 @@ module Patterns = res let decodedTopResources = - new Dictionary(10, HashIdentity.Structural) + Dictionary(10, HashIdentity.Structural) [] type ReflectedDefinitionTableKey = @@ -2347,7 +2347,7 @@ module Patterns = type ReflectedDefinitionTableEntry = Entry of Bindable let reflectedDefinitionTable = - new Dictionary(10, HashIdentity.Structural) + Dictionary(10, HashIdentity.Structural) let registerReflectedDefinitions (assem, resourceName, bytes, referencedTypes) = let defns = unpickleReflectedDefns assem referencedTypes bytes diff --git a/src/FSharp.Core/seq.fs b/src/FSharp.Core/seq.fs index c2e21f3af9d..84c2c6245f2 100644 --- a/src/FSharp.Core/seq.fs +++ b/src/FSharp.Core/seq.fs @@ -599,7 +599,7 @@ module Seq = mkSeq (fun () -> unfold f x) let inline indexNotFound () = - raise (new KeyNotFoundException(SR.GetString(SR.keyNotFoundAlt))) + raise (KeyNotFoundException(SR.GetString(SR.keyNotFoundAlt))) [] let delay generator = diff --git a/src/FSharp.Core/seqcore.fs b/src/FSharp.Core/seqcore.fs index 24751a523e2..f78f0f75c9f 100644 --- a/src/FSharp.Core/seqcore.fs +++ b/src/FSharp.Core/seqcore.fs @@ -16,9 +16,9 @@ open Microsoft.FSharp.Collections module internal IEnumerator = - let noReset() = raise (new NotSupportedException(SR.GetString(SR.resetNotSupported))) - let notStarted() = raise (new InvalidOperationException(SR.GetString(SR.enumerationNotStarted))) - let alreadyFinished() = raise (new InvalidOperationException(SR.GetString(SR.enumerationAlreadyFinished))) + let noReset() = raise (NotSupportedException(SR.GetString(SR.resetNotSupported))) + let notStarted() = raise (InvalidOperationException(SR.GetString(SR.enumerationNotStarted))) + let alreadyFinished() = raise (InvalidOperationException(SR.GetString(SR.enumerationAlreadyFinished))) let check started = if not started then notStarted() let dispose (r : IDisposable) = r.Dispose() @@ -529,7 +529,7 @@ type GeneratedSequenceBase<'T>() = [] member x.MoveNext() = x.MoveNextImpl() - member _.Reset() = raise <| new NotSupportedException() + member _.Reset() = raise <| NotSupportedException() [] type ListCollector<'T> = diff --git a/src/FSharp.Core/set.fs b/src/FSharp.Core/set.fs index 3f387f11140..0f3848569d3 100644 --- a/src/FSharp.Core/set.fs +++ b/src/FSharp.Core/set.fs @@ -936,14 +936,14 @@ type Set<[] 'T when 'T: comparison>(comparer: IComparer<' interface ICollection<'T> with member s.Add x = ignore x - raise (new NotSupportedException("ReadOnlyCollection")) + raise (NotSupportedException("ReadOnlyCollection")) member s.Clear() = - raise (new NotSupportedException("ReadOnlyCollection")) + raise (NotSupportedException("ReadOnlyCollection")) member s.Remove x = ignore x - raise (new NotSupportedException("ReadOnlyCollection")) + raise (NotSupportedException("ReadOnlyCollection")) member s.Contains x = SetTree.mem s.Comparer x s.Tree diff --git a/src/FSharp.Core/string.fs b/src/FSharp.Core/string.fs index d716b793db1..ff327c8c3b2 100644 --- a/src/FSharp.Core/string.fs +++ b/src/FSharp.Core/string.fs @@ -66,7 +66,7 @@ module String = result.[i] <- mapping c i <- i + 1 - new String(result) + String(result) [] let mapi (mapping: int -> char -> char) (str: string) = @@ -84,7 +84,7 @@ module String = result.[i] <- f.Invoke(i, result.[i]) i <- i + 1 - new String(result) + String(result) [] let filter (predicate: char -> bool) (str: string) = @@ -150,7 +150,7 @@ module String = String.Empty elif len = 1 then - new String(str.[0], count) + String(str.[0], count) elif count <= 4 then match count with @@ -178,7 +178,7 @@ module String = // finally, copy the remain half, or less-then half Array.Copy(target, 0, target, i, target.Length - i) - new String(target) + String(target) [] let forall predicate (str: string) = From 43ee89ad699407d7a368e5221f3180a0ae7f065a Mon Sep 17 00:00:00 2001 From: Eugene Auduchinok Date: Wed, 15 Oct 2025 14:41:35 +0200 Subject: [PATCH 3/6] Cleanup: redundant opens --- src/Compiler/AbstractIL/il.fs | 1 - src/Compiler/AbstractIL/ilprint.fs | 1 - src/Compiler/AbstractIL/ilread.fs | 1 - src/Compiler/AbstractIL/ilsign.fs | 2 -- src/Compiler/AbstractIL/ilsign.fsi | 1 - src/Compiler/AbstractIL/ilsupp.fs | 2 -- src/Compiler/AbstractIL/ilwrite.fs | 2 -- src/Compiler/AbstractIL/ilwritepdb.fs | 4 ---- src/Compiler/Checking/CheckBasics.fs | 2 -- src/Compiler/Checking/CheckDeclarations.fs | 2 -- src/Compiler/Checking/CheckDeclarations.fsi | 1 - src/Compiler/Checking/CheckFormatStrings.fs | 1 - .../Checking/CheckIncrementalClasses.fs | 1 - src/Compiler/Checking/CheckPatterns.fs | 1 - .../Checking/CheckRecordSyntaxHelpers.fs | 1 - .../CheckComputationExpressions.fs | 1 - .../Expressions/CheckSequenceExpressions.fs | 1 - src/Compiler/Checking/FindUnsolved.fs | 1 - src/Compiler/Checking/MethodOverrides.fs | 2 -- src/Compiler/Checking/NameResolution.fs | 1 - .../Checking/PatternMatchCompilation.fs | 2 -- src/Compiler/Checking/PostInferenceChecks.fs | 1 - src/Compiler/Checking/TailCallChecks.fs | 1 - src/Compiler/Checking/TypeHierarchy.fs | 9 -------- src/Compiler/Checking/TypeHierarchy.fsi | 4 ---- src/Compiler/Checking/import.fs | 6 ------ src/Compiler/Checking/import.fsi | 1 - src/Compiler/Checking/infos.fs | 3 --- src/Compiler/CodeGen/EraseUnions.fs | 1 - src/Compiler/CodeGen/IlxGen.fs | 2 -- src/Compiler/CodeGen/IlxGen.fsi | 1 - src/Compiler/CodeGen/IlxGenSupport.fs | 1 - src/Compiler/CodeGen/IlxGenSupport.fsi | 1 - src/Compiler/Driver/CompilerConfig.fs | 2 -- src/Compiler/Driver/CompilerConfig.fsi | 1 - src/Compiler/Driver/CompilerDiagnostics.fsi | 1 - src/Compiler/Driver/CompilerImports.fs | 3 --- src/Compiler/Driver/CompilerImports.fsi | 1 - src/Compiler/Driver/CompilerOptions.fs | 2 -- src/Compiler/Driver/ParseAndCheckInputs.fsi | 1 - src/Compiler/Driver/StaticLinking.fs | 2 -- src/Compiler/Driver/XmlDocFileWriter.fs | 2 -- src/Compiler/Driver/fsc.fsi | 1 - src/Compiler/Facilities/AsyncMemoize.fs | 1 - src/Compiler/Facilities/AsyncMemoize.fsi | 3 --- src/Compiler/Facilities/DiagnosticsLogger.fs | 2 -- src/Compiler/Facilities/prim-lexing.fs | 1 - .../Interactive/ControlledExecution.fs | 2 -- .../Interactive/FSharpInteractiveServer.fs | 2 -- src/Compiler/Interactive/fsi.fsi | 1 - src/Compiler/Interactive/fsihelp.fs | 1 - src/Compiler/Optimize/DetupleArgs.fs | 1 - src/Compiler/Optimize/LowerCalls.fs | 1 - .../Optimize/LowerComputedCollections.fs | 1 - src/Compiler/Optimize/LowerSequences.fsi | 1 - src/Compiler/Optimize/LowerStateMachines.fs | 1 - src/Compiler/Optimize/Optimizer.fs | 2 -- src/Compiler/Service/BackgroundCompiler.fs | 14 ------------- src/Compiler/Service/BackgroundCompiler.fsi | 3 --- src/Compiler/Service/FSharpCheckerResults.fs | 4 ---- src/Compiler/Service/FSharpCheckerResults.fsi | 4 ---- src/Compiler/Service/FSharpProjectSnapshot.fs | 1 - src/Compiler/Service/FSharpSource.fs | 1 - src/Compiler/Service/FSharpWorkspace.fs | 3 --- src/Compiler/Service/IncrementalBuild.fsi | 2 -- src/Compiler/Service/ServiceLexing.fsi | 1 - src/Compiler/Service/TransparentCompiler.fs | 2 -- src/Compiler/Service/TransparentCompiler.fsi | 1 - src/Compiler/Service/service.fs | 18 ---------------- src/Compiler/Service/service.fsi | 5 ----- src/Compiler/Symbols/SymbolPatterns.fs | 2 -- src/Compiler/SyntaxTree/LexHelpers.fs | 1 - src/Compiler/SyntaxTree/ParseHelpers.fsi | 1 - src/Compiler/TypedTree/TypedTree.fs | 2 -- src/Compiler/TypedTree/TypedTreeBasics.fsi | 1 - .../TypedTree/UpdatePrettyTyparNames.fs | 1 - src/Compiler/Utilities/Caches.fs | 1 - src/Compiler/Utilities/LruCache.fs | 1 - src/Compiler/Utilities/PathMap.fs | 1 - src/Compiler/Utilities/TypeHashing.fs | 2 -- src/Compiler/Utilities/sformat.fsi | 1 - src/FSharp.Core/Linq.fs | 2 -- src/FSharp.Core/MutableTuple.fs | 2 -- src/FSharp.Core/Query.fs | 4 ---- src/FSharp.Core/QueryExtensions.fs | 3 --- src/FSharp.Core/Random.fs | 1 - src/FSharp.Core/array.fs | 2 -- src/FSharp.Core/array.fsi | 1 - src/FSharp.Core/array2.fs | 1 - src/FSharp.Core/array2.fsi | 2 -- src/FSharp.Core/array3.fs | 3 --- src/FSharp.Core/array3.fsi | 3 --- src/FSharp.Core/collections.fs | 1 - src/FSharp.Core/collections.fsi | 3 --- src/FSharp.Core/event.fs | 3 --- src/FSharp.Core/event.fsi | 2 -- src/FSharp.Core/fslib-extra-pervasives.fs | 3 --- src/FSharp.Core/fslib-extra-pervasives.fsi | 1 - src/FSharp.Core/list.fs | 1 - src/FSharp.Core/list.fsi | 1 - src/FSharp.Core/local.fs | 2 -- src/FSharp.Core/math/z.fs | 1 - src/FSharp.Core/math/z.fsi | 2 -- src/FSharp.Core/nativeptr.fs | 8 ------- src/FSharp.Core/nativeptr.fsi | 1 - src/FSharp.Core/prim-types.fs | 21 ++----------------- src/FSharp.Core/printf.fs | 1 - src/FSharp.Core/printf.fsi | 1 - src/FSharp.Core/quotations.fs | 6 ------ src/FSharp.Core/reflect.fs | 1 - src/FSharp.Core/reflect.fsi | 2 -- src/FSharp.Core/resumable.fs | 4 ---- src/FSharp.Core/seq.fs | 2 -- src/FSharp.Core/seqcore.fs | 6 ------ src/FSharp.Core/seqcore.fsi | 2 -- src/FSharp.Core/set.fs | 1 - src/FSharp.Core/set.fsi | 2 -- src/FSharp.Core/tasks.fs | 1 - .../AssemblyContentProviderTests.fs | 1 - .../AssemblySigningAttributes.fs | 1 - .../BlockTests.fs | 1 - .../ByteMemoryTests.fs | 2 -- tests/FSharp.Compiler.Service.Tests/Common.fs | 1 - .../FSharp.Compiler.Service.Tests/FsiTests.fs | 2 -- .../ManglingNameOfProvidedTypes.fs | 3 --- .../ProductVersion.fs | 2 -- .../RangeTests.fs | 1 - 127 files changed, 2 insertions(+), 286 deletions(-) diff --git a/src/Compiler/AbstractIL/il.fs b/src/Compiler/AbstractIL/il.fs index a35d7fadb98..2b3f984938f 100644 --- a/src/Compiler/AbstractIL/il.fs +++ b/src/Compiler/AbstractIL/il.fs @@ -21,7 +21,6 @@ open System.Text open System.Threading open FSharp.Compiler.AbstractIL.Diagnostics -open Internal.Utilities.Library open Internal.Utilities let logging = false diff --git a/src/Compiler/AbstractIL/ilprint.fs b/src/Compiler/AbstractIL/ilprint.fs index 4ce956971c0..12e421f6829 100644 --- a/src/Compiler/AbstractIL/ilprint.fs +++ b/src/Compiler/AbstractIL/ilprint.fs @@ -8,7 +8,6 @@ open System.Reflection open FSharp.Compiler.IO open Internal.Utilities.Library -open FSharp.Compiler.AbstractIL.AsciiConstants open FSharp.Compiler.AbstractIL.ILX.Types open FSharp.Compiler.AbstractIL.IL diff --git a/src/Compiler/AbstractIL/ilread.fs b/src/Compiler/AbstractIL/ilread.fs index 4f280f8ad29..35ba3903196 100644 --- a/src/Compiler/AbstractIL/ilread.fs +++ b/src/Compiler/AbstractIL/ilread.fs @@ -12,7 +12,6 @@ module FSharp.Compiler.AbstractIL.ILBinaryReader open System open System.Collections.Concurrent open System.Collections.Generic -open System.Collections.Immutable open System.Diagnostics open System.IO open System.Text diff --git a/src/Compiler/AbstractIL/ilsign.fs b/src/Compiler/AbstractIL/ilsign.fs index ac06baa5d54..53add630789 100644 --- a/src/Compiler/AbstractIL/ilsign.fs +++ b/src/Compiler/AbstractIL/ilsign.fs @@ -9,11 +9,9 @@ open System.IO open System.Collections.Immutable open System.Reflection.PortableExecutable open System.Security.Cryptography -open System.Reflection open System.Runtime.InteropServices open Internal.Utilities.Library -open FSharp.Compiler.IO type KeyType = | Public diff --git a/src/Compiler/AbstractIL/ilsign.fsi b/src/Compiler/AbstractIL/ilsign.fsi index 8e7b2fdc751..588f83f84b4 100644 --- a/src/Compiler/AbstractIL/ilsign.fsi +++ b/src/Compiler/AbstractIL/ilsign.fsi @@ -7,7 +7,6 @@ module internal FSharp.Compiler.AbstractIL.StrongNameSign -open System open System.IO //--------------------------------------------------------------------- diff --git a/src/Compiler/AbstractIL/ilsupp.fs b/src/Compiler/AbstractIL/ilsupp.fs index cd30137faaf..a3fff8f8065 100644 --- a/src/Compiler/AbstractIL/ilsupp.fs +++ b/src/Compiler/AbstractIL/ilsupp.fs @@ -4,9 +4,7 @@ module internal FSharp.Compiler.AbstractIL.Support open System open System.IO -open System.Reflection open System.Runtime.InteropServices -open Internal.Utilities.Library open FSharp.Compiler.AbstractIL.NativeRes open FSharp.Compiler.IO diff --git a/src/Compiler/AbstractIL/ilwrite.fs b/src/Compiler/AbstractIL/ilwrite.fs index b1ab074ed63..116e40d50d5 100644 --- a/src/Compiler/AbstractIL/ilwrite.fs +++ b/src/Compiler/AbstractIL/ilwrite.fs @@ -3223,8 +3223,6 @@ let count f arr = Array.fold (fun x y -> x + f y) 0x0 arr module FileSystemUtilities = - open System.Reflection - open System.Globalization let progress = try Environment.GetEnvironmentVariable("FSharp_DebugSetFilePermissions") <> null with _ -> false /// Arbitrary value diff --git a/src/Compiler/AbstractIL/ilwritepdb.fs b/src/Compiler/AbstractIL/ilwritepdb.fs index 0b437e9e892..1f6834a2dab 100644 --- a/src/Compiler/AbstractIL/ilwritepdb.fs +++ b/src/Compiler/AbstractIL/ilwritepdb.fs @@ -7,19 +7,15 @@ open System.Collections.Generic open System.Collections.Immutable open System.IO open System.IO.Compression -open System.Reflection open System.Reflection.Metadata open System.Reflection.Metadata.Ecma335 open System.Security.Cryptography open System.Text open Internal.Utilities open FSharp.Compiler.AbstractIL.IL -open FSharp.Compiler.AbstractIL.Support open Internal.Utilities.Library -open Internal.Utilities.Library.Extras open FSharp.Compiler.DiagnosticsLogger open FSharp.Compiler.IO -open FSharp.Compiler.Text.Range type BlobBuildingStream() = inherit Stream() diff --git a/src/Compiler/Checking/CheckBasics.fs b/src/Compiler/Checking/CheckBasics.fs index 835fd27bcaf..cc172081fed 100644 --- a/src/Compiler/Checking/CheckBasics.fs +++ b/src/Compiler/Checking/CheckBasics.fs @@ -7,7 +7,6 @@ open System.Collections.Generic open FSharp.Compiler.Diagnostics open Internal.Utilities.Library -open Internal.Utilities.Library.Extras open Internal.Utilities.Collections open FSharp.Compiler open FSharp.Compiler.AccessibilityLogic @@ -25,7 +24,6 @@ open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeOps #if !NO_TYPEPROVIDERS -open FSharp.Compiler.TypeProviders #endif /// The ValReprInfo for a value, except the number of typars is not yet inferred diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index 3b6e05f0bdb..7247049f9d4 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -415,8 +415,6 @@ let private CheckDuplicatesAbstractMethodParamsSig (typeSpecs: SynTypeDefnSig l | _ -> () module TcRecdUnionAndEnumDeclarations = - open CheckExpressionsOps - let CombineReprAccess parent vis = match parent with | ParentNone -> vis diff --git a/src/Compiler/Checking/CheckDeclarations.fsi b/src/Compiler/Checking/CheckDeclarations.fsi index 9b06fcc828d..25a2af850b9 100644 --- a/src/Compiler/Checking/CheckDeclarations.fsi +++ b/src/Compiler/Checking/CheckDeclarations.fsi @@ -5,7 +5,6 @@ module internal FSharp.Compiler.CheckDeclarations open FSharp.Compiler.Diagnostics open Internal.Utilities.Library open FSharp.Compiler.CheckBasics -open FSharp.Compiler.CompilerGlobalState open FSharp.Compiler.NameResolution open FSharp.Compiler.Import open FSharp.Compiler.Syntax diff --git a/src/Compiler/Checking/CheckFormatStrings.fs b/src/Compiler/Checking/CheckFormatStrings.fs index c7796957982..45d993f5143 100644 --- a/src/Compiler/Checking/CheckFormatStrings.fs +++ b/src/Compiler/Checking/CheckFormatStrings.fs @@ -6,7 +6,6 @@ open System open System.Text open Internal.Utilities.Library open Internal.Utilities.Library.Extras -open FSharp.Compiler.ConstraintSolver open FSharp.Compiler.DiagnosticsLogger open FSharp.Compiler.NameResolution open FSharp.Compiler.Syntax diff --git a/src/Compiler/Checking/CheckIncrementalClasses.fs b/src/Compiler/Checking/CheckIncrementalClasses.fs index d11656a8b63..c94218973bd 100644 --- a/src/Compiler/Checking/CheckIncrementalClasses.fs +++ b/src/Compiler/Checking/CheckIncrementalClasses.fs @@ -4,7 +4,6 @@ module internal FSharp.Compiler.CheckIncrementalClasses open System -open FSharp.Compiler.Diagnostics open FSharp.Compiler.Features open Internal.Utilities.Collections open Internal.Utilities.Library diff --git a/src/Compiler/Checking/CheckPatterns.fs b/src/Compiler/Checking/CheckPatterns.fs index eb61edf7eeb..e6a637c2d80 100644 --- a/src/Compiler/Checking/CheckPatterns.fs +++ b/src/Compiler/Checking/CheckPatterns.fs @@ -8,7 +8,6 @@ open System open System.Collections.Generic open Internal.Utilities.Library -open Internal.Utilities.Library.Extras open FSharp.Compiler.AccessibilityLogic open FSharp.Compiler.AttributeChecking open FSharp.Compiler.CheckExpressions diff --git a/src/Compiler/Checking/CheckRecordSyntaxHelpers.fs b/src/Compiler/Checking/CheckRecordSyntaxHelpers.fs index 861ad5587c6..945523a1de2 100644 --- a/src/Compiler/Checking/CheckRecordSyntaxHelpers.fs +++ b/src/Compiler/Checking/CheckRecordSyntaxHelpers.fs @@ -13,7 +13,6 @@ open FSharp.Compiler.Text.Range open FSharp.Compiler.TypedTree open FSharp.Compiler.Xml open FSharp.Compiler.SyntaxTrivia -open TypedTreeOps /// Merges updates to nested record fields on the same level in record copy-and-update. /// diff --git a/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs b/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs index 72cd0767755..64d1cc989be 100644 --- a/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs +++ b/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs @@ -4,7 +4,6 @@ /// with generalization at appropriate points. module internal FSharp.Compiler.CheckComputationExpressions -open FSharp.Compiler.TcGlobals open Internal.Utilities.Library open FSharp.Compiler.AccessibilityLogic open FSharp.Compiler.AttributeChecking diff --git a/src/Compiler/Checking/Expressions/CheckSequenceExpressions.fs b/src/Compiler/Checking/Expressions/CheckSequenceExpressions.fs index c7eed9034b6..0a12e48b306 100644 --- a/src/Compiler/Checking/Expressions/CheckSequenceExpressions.fs +++ b/src/Compiler/Checking/Expressions/CheckSequenceExpressions.fs @@ -3,7 +3,6 @@ /// Sequence expressions checking module internal FSharp.Compiler.CheckSequenceExpressions -open Internal.Utilities.Library open FSharp.Compiler.CheckBasics open FSharp.Compiler.CheckExpressions open FSharp.Compiler.CheckExpressionsOps diff --git a/src/Compiler/Checking/FindUnsolved.fs b/src/Compiler/Checking/FindUnsolved.fs index fb4fb05251f..c1de629a07c 100644 --- a/src/Compiler/Checking/FindUnsolved.fs +++ b/src/Compiler/Checking/FindUnsolved.fs @@ -5,7 +5,6 @@ module internal FSharp.Compiler.FindUnsolved open Internal.Utilities.Collections open Internal.Utilities.Library -open Internal.Utilities.Library.Extras open FSharp.Compiler open FSharp.Compiler.DiagnosticsLogger open FSharp.Compiler.Text diff --git a/src/Compiler/Checking/MethodOverrides.fs b/src/Compiler/Checking/MethodOverrides.fs index 4621aed620e..386390187bd 100644 --- a/src/Compiler/Checking/MethodOverrides.fs +++ b/src/Compiler/Checking/MethodOverrides.fs @@ -107,8 +107,6 @@ exception TypeIsImplicitlyAbstract of range exception OverrideDoesntOverride of DisplayEnv * OverrideInfo * MethInfo option * TcGlobals * Import.ImportMap * range module DispatchSlotChecking = - open Import - /// Print the signature of an override to a buffer as part of an error message let PrintOverrideToBuffer denv os (Override(_, _, id, methTypars, memberToParentInst, argTys, retTy, _, _, _)) = let denv = { denv with showTyparBinding = true } diff --git a/src/Compiler/Checking/NameResolution.fs b/src/Compiler/Checking/NameResolution.fs index 025ccb3c022..181911ec2bd 100644 --- a/src/Compiler/Checking/NameResolution.fs +++ b/src/Compiler/Checking/NameResolution.fs @@ -6,7 +6,6 @@ module internal FSharp.Compiler.NameResolution open System.Collections.Generic -open Internal.Utilities open Internal.Utilities.Collections open Internal.Utilities.Library open Internal.Utilities.Library.Extras diff --git a/src/Compiler/Checking/PatternMatchCompilation.fs b/src/Compiler/Checking/PatternMatchCompilation.fs index ba184710ea4..15bb5373205 100644 --- a/src/Compiler/Checking/PatternMatchCompilation.fs +++ b/src/Compiler/Checking/PatternMatchCompilation.fs @@ -21,10 +21,8 @@ open FSharp.Compiler.Text.Range open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeBasics open FSharp.Compiler.TypedTreeOps -open FSharp.Compiler.TypedTreeOps.DebugPrint open FSharp.Compiler.TypeRelations open type System.MemoryExtensions -open Import exception MatchIncomplete of bool * (string * bool) option * range exception RuleNeverMatched of range diff --git a/src/Compiler/Checking/PostInferenceChecks.fs b/src/Compiler/Checking/PostInferenceChecks.fs index 1aadec93456..906c0fc82db 100644 --- a/src/Compiler/Checking/PostInferenceChecks.fs +++ b/src/Compiler/Checking/PostInferenceChecks.fs @@ -19,7 +19,6 @@ open FSharp.Compiler.Infos open FSharp.Compiler.InfoReader open FSharp.Compiler.Syntax open FSharp.Compiler.Syntax.PrettyNaming -open FSharp.Compiler.SyntaxTreeOps open FSharp.Compiler.TcGlobals open FSharp.Compiler.Text open FSharp.Compiler.Text.Range diff --git a/src/Compiler/Checking/TailCallChecks.fs b/src/Compiler/Checking/TailCallChecks.fs index bf746f911fe..6a687add26b 100644 --- a/src/Compiler/Checking/TailCallChecks.fs +++ b/src/Compiler/Checking/TailCallChecks.fs @@ -4,7 +4,6 @@ module internal FSharp.Compiler.TailCallChecks open Internal.Utilities.Collections open Internal.Utilities.Library -open Internal.Utilities.Library.Extras open FSharp.Compiler open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.DiagnosticsLogger diff --git a/src/Compiler/Checking/TypeHierarchy.fs b/src/Compiler/Checking/TypeHierarchy.fs index 587e8527fdd..c37321f4b4a 100644 --- a/src/Compiler/Checking/TypeHierarchy.fs +++ b/src/Compiler/Checking/TypeHierarchy.fs @@ -2,27 +2,18 @@ module internal FSharp.Compiler.TypeHierarchy -open System -open Internal.Utilities.Library open Internal.Utilities.Library.Extras -open FSharp.Compiler open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.DiagnosticsLogger open FSharp.Compiler.Import open FSharp.Compiler.Import.Nullness open FSharp.Compiler.Features -open FSharp.Compiler.Syntax -open FSharp.Compiler.SyntaxTreeOps open FSharp.Compiler.TcGlobals -open FSharp.Compiler.Text open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeBasics open FSharp.Compiler.TypedTreeOps open FSharp.Compiler.TypedTreeOps.DebugPrint -open FSharp.Compiler.Xml - #if !NO_TYPEPROVIDERS -open FSharp.Compiler.TypeProviders #endif //------------------------------------------------------------------------- diff --git a/src/Compiler/Checking/TypeHierarchy.fsi b/src/Compiler/Checking/TypeHierarchy.fsi index 8633f9827f9..88ac64ff5b8 100644 --- a/src/Compiler/Checking/TypeHierarchy.fsi +++ b/src/Compiler/Checking/TypeHierarchy.fsi @@ -2,18 +2,14 @@ module internal FSharp.Compiler.TypeHierarchy -open FSharp.Compiler open FSharp.Compiler.AbstractIL.IL -open FSharp.Compiler.Syntax open FSharp.Compiler.Import open FSharp.Compiler.TcGlobals open FSharp.Compiler.Text -open FSharp.Compiler.Xml open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeOps #if !NO_TYPEPROVIDERS -open FSharp.Compiler.TypeProviders #endif /// Get the base type of a type, taking into account type instantiations. Return None if the diff --git a/src/Compiler/Checking/import.fs b/src/Compiler/Checking/import.fs index 0e9a861a37e..d7ca0e514cc 100644 --- a/src/Compiler/Checking/import.fs +++ b/src/Compiler/Checking/import.fs @@ -6,12 +6,8 @@ module internal FSharp.Compiler.Import open System.Collections.Concurrent open System.Collections.Generic open System.Collections.Immutable -open System.Diagnostics - open Internal.Utilities.Library open Internal.Utilities.Library.Extras -open Internal.Utilities.TypeHashing - open FSharp.Compiler open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.CompilerGlobalState @@ -24,8 +20,6 @@ open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeBasics open FSharp.Compiler.TypedTreeOps open FSharp.Compiler.TcGlobals -open FSharp.Compiler.Caches - #if !NO_TYPEPROVIDERS open FSharp.Compiler.TypeProviders #endif diff --git a/src/Compiler/Checking/import.fsi b/src/Compiler/Checking/import.fsi index c0ee183f2e9..fb1f191effc 100644 --- a/src/Compiler/Checking/import.fsi +++ b/src/Compiler/Checking/import.fsi @@ -5,7 +5,6 @@ module internal FSharp.Compiler.Import open Internal.Utilities.Library open FSharp.Compiler.AbstractIL.IL -open FSharp.Compiler.Caches open FSharp.Compiler.TcGlobals open FSharp.Compiler.Text open FSharp.Compiler.Xml diff --git a/src/Compiler/Checking/infos.fs b/src/Compiler/Checking/infos.fs index 47fc98edde1..79a73ee39fa 100644 --- a/src/Compiler/Checking/infos.fs +++ b/src/Compiler/Checking/infos.fs @@ -17,14 +17,11 @@ open FSharp.Compiler.Text open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeBasics open FSharp.Compiler.TypedTreeOps -open FSharp.Compiler.TypedTreeOps.DebugPrint open FSharp.Compiler.TypeHierarchy open FSharp.Compiler.Xml #if !NO_TYPEPROVIDERS open FSharp.Compiler.TypeProviders -open FSharp.Compiler.AbstractIL - #endif //------------------------------------------------------------------------- diff --git a/src/Compiler/CodeGen/EraseUnions.fs b/src/Compiler/CodeGen/EraseUnions.fs index a6fcad9aa66..43dfc00ee2e 100644 --- a/src/Compiler/CodeGen/EraseUnions.fs +++ b/src/Compiler/CodeGen/EraseUnions.fs @@ -10,7 +10,6 @@ open System.Reflection open Internal.Utilities.Library open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeOps -open FSharp.Compiler.Features open FSharp.Compiler.TcGlobals open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.AbstractIL.ILX.Types diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index 27b2687d5a1..2db510ec3e0 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -12145,8 +12145,6 @@ let GenerateCode (cenv, anonTypeTable, eenv, CheckedAssemblyAfterOptimization im // If we know how/where the field was generated, then we can lookup via reflection. //------------------------------------------------------------------------- -open System - /// The lookup* functions are the conversions available from ilreflect. type ExecutionContext = { diff --git a/src/Compiler/CodeGen/IlxGen.fsi b/src/Compiler/CodeGen/IlxGen.fsi index bb78a30fe41..cd9dd0f2ffb 100644 --- a/src/Compiler/CodeGen/IlxGen.fsi +++ b/src/Compiler/CodeGen/IlxGen.fsi @@ -4,7 +4,6 @@ module internal FSharp.Compiler.IlxGen open System open System.IO -open System.Reflection open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.TypedTree open FSharp.Compiler.TcGlobals diff --git a/src/Compiler/CodeGen/IlxGenSupport.fs b/src/Compiler/CodeGen/IlxGenSupport.fs index a96a860652f..c4ffd7fc00d 100644 --- a/src/Compiler/CodeGen/IlxGenSupport.fs +++ b/src/Compiler/CodeGen/IlxGenSupport.fs @@ -4,7 +4,6 @@ module internal FSharp.Compiler.IlxGenSupport open System.Reflection -open Internal.Utilities.Library open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.TcGlobals open FSharp.Compiler.Text.Range diff --git a/src/Compiler/CodeGen/IlxGenSupport.fsi b/src/Compiler/CodeGen/IlxGenSupport.fsi index dba574aef4e..fc46510706e 100644 --- a/src/Compiler/CodeGen/IlxGenSupport.fsi +++ b/src/Compiler/CodeGen/IlxGenSupport.fsi @@ -3,7 +3,6 @@ /// The ILX generator. module internal FSharp.Compiler.IlxGenSupport -open System.Reflection open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.TcGlobals diff --git a/src/Compiler/Driver/CompilerConfig.fs b/src/Compiler/Driver/CompilerConfig.fs index ddde2887a4a..325063e4b6f 100644 --- a/src/Compiler/Driver/CompilerConfig.fs +++ b/src/Compiler/Driver/CompilerConfig.fs @@ -27,8 +27,6 @@ open FSharp.Compiler.Text open FSharp.Compiler.Text.Range open FSharp.Compiler.Xml open FSharp.Compiler.TypedTree -open FSharp.Compiler.BuildGraph - #if !NO_TYPEPROVIDERS open FSharp.Core.CompilerServices #endif diff --git a/src/Compiler/Driver/CompilerConfig.fsi b/src/Compiler/Driver/CompilerConfig.fsi index 0e6c25727f8..646b4477be3 100644 --- a/src/Compiler/Driver/CompilerConfig.fsi +++ b/src/Compiler/Driver/CompilerConfig.fsi @@ -19,7 +19,6 @@ open FSharp.Compiler.Features open FSharp.Compiler.CodeAnalysis open FSharp.Compiler.Syntax open FSharp.Compiler.Text -open FSharp.Compiler.BuildGraph exception FileNameNotResolved of searchedLocations: string * fileName: string * range: range diff --git a/src/Compiler/Driver/CompilerDiagnostics.fsi b/src/Compiler/Driver/CompilerDiagnostics.fsi index 1f6e91d0012..dc9bccc3362 100644 --- a/src/Compiler/Driver/CompilerDiagnostics.fsi +++ b/src/Compiler/Driver/CompilerDiagnostics.fsi @@ -7,7 +7,6 @@ open System.Text open FSharp.Compiler.CompilerConfig open FSharp.Compiler.Diagnostics open FSharp.Compiler.DiagnosticsLogger -open FSharp.Compiler.Syntax open FSharp.Compiler.Text #if DEBUG diff --git a/src/Compiler/Driver/CompilerImports.fs b/src/Compiler/Driver/CompilerImports.fs index 4ab1ca3d7e4..321a5c645fb 100644 --- a/src/Compiler/Driver/CompilerImports.fs +++ b/src/Compiler/Driver/CompilerImports.fs @@ -6,7 +6,6 @@ module internal FSharp.Compiler.CompilerImports open System open System.Collections.Generic -open System.Collections.Immutable open System.Diagnostics open System.IO open System.IO.Compression @@ -40,8 +39,6 @@ open FSharp.Compiler.TypedTreePickle open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeBasics open FSharp.Compiler.TypedTreeOps -open FSharp.Compiler.BuildGraph - #if !NO_TYPEPROVIDERS open FSharp.Compiler.TypeProviders open FSharp.Core.CompilerServices diff --git a/src/Compiler/Driver/CompilerImports.fsi b/src/Compiler/Driver/CompilerImports.fsi index 2a95347ecbf..9da0ef71b1d 100644 --- a/src/Compiler/Driver/CompilerImports.fsi +++ b/src/Compiler/Driver/CompilerImports.fsi @@ -16,7 +16,6 @@ open FSharp.Compiler.Optimizer open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeOps open FSharp.Compiler.TcGlobals -open FSharp.Compiler.BuildGraph open FSharp.Compiler.IO open FSharp.Compiler.Text open FSharp.Core.CompilerServices diff --git a/src/Compiler/Driver/CompilerOptions.fs b/src/Compiler/Driver/CompilerOptions.fs index a841c7da0e6..efaf3a7009f 100644 --- a/src/Compiler/Driver/CompilerOptions.fs +++ b/src/Compiler/Driver/CompilerOptions.fs @@ -5,7 +5,6 @@ module internal FSharp.Compiler.CompilerOptions open System -open System.Diagnostics open System.IO open FSharp.Compiler.Optimizer open Internal.Utilities.Library @@ -19,7 +18,6 @@ open FSharp.Compiler.Diagnostics open FSharp.Compiler.Features open FSharp.Compiler.IO open FSharp.Compiler.Text.Range -open FSharp.Compiler.Text open FSharp.Compiler.TypedTreeOps open FSharp.Compiler.DiagnosticsLogger diff --git a/src/Compiler/Driver/ParseAndCheckInputs.fsi b/src/Compiler/Driver/ParseAndCheckInputs.fsi index ade044d2c92..3e47c3c17c6 100644 --- a/src/Compiler/Driver/ParseAndCheckInputs.fsi +++ b/src/Compiler/Driver/ParseAndCheckInputs.fsi @@ -12,7 +12,6 @@ open FSharp.Compiler.CompilerImports open FSharp.Compiler.Diagnostics open FSharp.Compiler.DependencyManager open FSharp.Compiler.DiagnosticsLogger -open FSharp.Compiler.Features open FSharp.Compiler.GraphChecking open FSharp.Compiler.NameResolution open FSharp.Compiler.Syntax diff --git a/src/Compiler/Driver/StaticLinking.fs b/src/Compiler/Driver/StaticLinking.fs index 3624ecef9b2..c7139d28793 100644 --- a/src/Compiler/Driver/StaticLinking.fs +++ b/src/Compiler/Driver/StaticLinking.fs @@ -19,8 +19,6 @@ open FSharp.Compiler.OptimizeInputs open FSharp.Compiler.TcGlobals open FSharp.Compiler.Text.Range open FSharp.Compiler.TypedTree -open FSharp.Compiler.TypedTreeBasics - #if !NO_TYPEPROVIDERS open FSharp.Compiler.TypeProviders #endif diff --git a/src/Compiler/Driver/XmlDocFileWriter.fs b/src/Compiler/Driver/XmlDocFileWriter.fs index fe6ac2a3fac..8a3eb618b4c 100644 --- a/src/Compiler/Driver/XmlDocFileWriter.fs +++ b/src/Compiler/Driver/XmlDocFileWriter.fs @@ -3,8 +3,6 @@ module internal FSharp.Compiler.XmlDocFileWriter open System.IO -open System.Reflection -open Internal.Utilities.Library open FSharp.Compiler.DiagnosticsLogger open FSharp.Compiler.IO open FSharp.Compiler.Text diff --git a/src/Compiler/Driver/fsc.fsi b/src/Compiler/Driver/fsc.fsi index 8731b5fae0c..377f82992a2 100644 --- a/src/Compiler/Driver/fsc.fsi +++ b/src/Compiler/Driver/fsc.fsi @@ -10,7 +10,6 @@ open FSharp.Compiler.Diagnostics open FSharp.Compiler.CompilerImports open FSharp.Compiler.DiagnosticsLogger open FSharp.Compiler.CodeAnalysis -open FSharp.Compiler.Syntax open FSharp.Compiler.TcGlobals /// DiagnosticLoggers can be sensitive to the TcConfig flags. During the checking diff --git a/src/Compiler/Facilities/AsyncMemoize.fs b/src/Compiler/Facilities/AsyncMemoize.fs index e776fe0aae0..c7ebc55bda3 100644 --- a/src/Compiler/Facilities/AsyncMemoize.fs +++ b/src/Compiler/Facilities/AsyncMemoize.fs @@ -7,7 +7,6 @@ open System.Threading.Tasks open System.Runtime.CompilerServices open FSharp.Compiler.DiagnosticsLogger -open Internal.Utilities.Library type AsyncLazyState<'t> = | Initial of computation: Async<'t> diff --git a/src/Compiler/Facilities/AsyncMemoize.fsi b/src/Compiler/Facilities/AsyncMemoize.fsi index 1014dfc6874..b83e21ba0e8 100644 --- a/src/Compiler/Facilities/AsyncMemoize.fsi +++ b/src/Compiler/Facilities/AsyncMemoize.fsi @@ -1,8 +1,5 @@ namespace Internal.Utilities.Collections -open System.Threading.Tasks -open FSharp.Compiler.BuildGraph - [] module internal Utils = diff --git a/src/Compiler/Facilities/DiagnosticsLogger.fs b/src/Compiler/Facilities/DiagnosticsLogger.fs index 4152b951a0a..1fc27dc82f4 100644 --- a/src/Compiler/Facilities/DiagnosticsLogger.fs +++ b/src/Compiler/Facilities/DiagnosticsLogger.fs @@ -2,7 +2,6 @@ module FSharp.Compiler.DiagnosticsLogger -open FSharp.Compiler open FSharp.Compiler.Diagnostics open FSharp.Compiler.Features open FSharp.Compiler.Text.Range @@ -14,7 +13,6 @@ open System.Threading open System.Runtime.CompilerServices open System.Runtime.InteropServices open Internal.Utilities.Library -open Internal.Utilities.Library.Extras open System.Threading.Tasks open System.Collections.Concurrent diff --git a/src/Compiler/Facilities/prim-lexing.fs b/src/Compiler/Facilities/prim-lexing.fs index 72c4fa22f58..90c7654bd65 100644 --- a/src/Compiler/Facilities/prim-lexing.fs +++ b/src/Compiler/Facilities/prim-lexing.fs @@ -9,7 +9,6 @@ open System.IO open System.Collections.Immutable open Internal.Utilities.Library -open Internal.Utilities.Collections open Internal.Utilities.Hashing type ISourceText = diff --git a/src/Compiler/Interactive/ControlledExecution.fs b/src/Compiler/Interactive/ControlledExecution.fs index ba03026bead..8fb4239d749 100644 --- a/src/Compiler/Interactive/ControlledExecution.fs +++ b/src/Compiler/Interactive/ControlledExecution.fs @@ -15,8 +15,6 @@ open System.Reflection open System.Threading open Internal.Utilities.FSharpEnvironment -open Internal.Utilities.Library - open Unchecked type internal ControlledExecution(isInteractive: bool) = diff --git a/src/Compiler/Interactive/FSharpInteractiveServer.fs b/src/Compiler/Interactive/FSharpInteractiveServer.fs index 557a1170e55..947bbe04b6b 100644 --- a/src/Compiler/Interactive/FSharpInteractiveServer.fs +++ b/src/Compiler/Interactive/FSharpInteractiveServer.fs @@ -3,10 +3,8 @@ namespace FSharp.Compiler.Interactive open System open System.Text -open System.Diagnostics open System.IO open System.IO.Pipes -open System.Threading module CtrlBreakHandlers = diff --git a/src/Compiler/Interactive/fsi.fsi b/src/Compiler/Interactive/fsi.fsi index 0e7415ca728..eebef0e63df 100644 --- a/src/Compiler/Interactive/fsi.fsi +++ b/src/Compiler/Interactive/fsi.fsi @@ -8,7 +8,6 @@ open System.Threading open FSharp.Compiler.CodeAnalysis open FSharp.Compiler.Diagnostics open FSharp.Compiler.Symbols -open Internal.Utilities.Library /// Represents an evaluated F# value [] diff --git a/src/Compiler/Interactive/fsihelp.fs b/src/Compiler/Interactive/fsihelp.fs index e4fb4e26887..8cffd66b1e1 100644 --- a/src/Compiler/Interactive/fsihelp.fs +++ b/src/Compiler/Interactive/fsihelp.fs @@ -1,7 +1,6 @@ module FSharp.Compiler.Interactive.FsiHelp open System -open System.Collections.Generic open System.IO open System.Text open System.Reflection diff --git a/src/Compiler/Optimize/DetupleArgs.fs b/src/Compiler/Optimize/DetupleArgs.fs index 0531f72ad1c..b0dd2d62835 100644 --- a/src/Compiler/Optimize/DetupleArgs.fs +++ b/src/Compiler/Optimize/DetupleArgs.fs @@ -4,7 +4,6 @@ module internal FSharp.Compiler.Detuple open Internal.Utilities.Collections open Internal.Utilities.Library -open Internal.Utilities.Library.Extras open FSharp.Compiler.DiagnosticsLogger open FSharp.Compiler.Syntax open FSharp.Compiler.TcGlobals diff --git a/src/Compiler/Optimize/LowerCalls.fs b/src/Compiler/Optimize/LowerCalls.fs index 682b39f1c20..19f4142c730 100644 --- a/src/Compiler/Optimize/LowerCalls.fs +++ b/src/Compiler/Optimize/LowerCalls.fs @@ -2,7 +2,6 @@ module internal FSharp.Compiler.LowerCalls -open Internal.Utilities.Library open FSharp.Compiler.DiagnosticsLogger open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeOps diff --git a/src/Compiler/Optimize/LowerComputedCollections.fs b/src/Compiler/Optimize/LowerComputedCollections.fs index 4e74722e1bf..da1fbbdd7aa 100644 --- a/src/Compiler/Optimize/LowerComputedCollections.fs +++ b/src/Compiler/Optimize/LowerComputedCollections.fs @@ -17,7 +17,6 @@ open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeBasics open FSharp.Compiler.TypedTreeOps open FSharp.Compiler.TypeHierarchy -open Import /// Build the 'test and dispose' part of a 'use' statement let BuildDisposableCleanup tcVal (g: TcGlobals) infoReader m (v: Val) = diff --git a/src/Compiler/Optimize/LowerSequences.fsi b/src/Compiler/Optimize/LowerSequences.fsi index 61ed7d87766..18e94c98e7e 100644 --- a/src/Compiler/Optimize/LowerSequences.fsi +++ b/src/Compiler/Optimize/LowerSequences.fsi @@ -3,7 +3,6 @@ module internal FSharp.Compiler.LowerSequenceExpressions open FSharp.Compiler.Import -open FSharp.Compiler.Syntax open FSharp.Compiler.TcGlobals open FSharp.Compiler.TypedTree open FSharp.Compiler.Text diff --git a/src/Compiler/Optimize/LowerStateMachines.fs b/src/Compiler/Optimize/LowerStateMachines.fs index 929b31d2aee..f3c3b8d7755 100644 --- a/src/Compiler/Optimize/LowerStateMachines.fs +++ b/src/Compiler/Optimize/LowerStateMachines.fs @@ -4,7 +4,6 @@ module internal FSharp.Compiler.LowerStateMachines open Internal.Utilities.Collections open Internal.Utilities.Library -open Internal.Utilities.Library.Extras open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.DiagnosticsLogger open FSharp.Compiler.TcGlobals diff --git a/src/Compiler/Optimize/Optimizer.fs b/src/Compiler/Optimize/Optimizer.fs index cf242d7b197..59a4e69ffe9 100644 --- a/src/Compiler/Optimize/Optimizer.fs +++ b/src/Compiler/Optimize/Optimizer.fs @@ -9,7 +9,6 @@ open Internal.Utilities.Collections open Internal.Utilities.Library open Internal.Utilities.Library.Extras open FSharp.Compiler -open FSharp.Compiler.AbstractIL.Diagnostics open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.AttributeChecking open FSharp.Compiler.CompilerGlobalState @@ -17,7 +16,6 @@ open FSharp.Compiler.DiagnosticsLogger open FSharp.Compiler.Text.Range open FSharp.Compiler.Syntax.PrettyNaming open FSharp.Compiler.Syntax -open FSharp.Compiler.SyntaxTreeOps open FSharp.Compiler.TcGlobals open FSharp.Compiler.Text open FSharp.Compiler.Text.Layout diff --git a/src/Compiler/Service/BackgroundCompiler.fs b/src/Compiler/Service/BackgroundCompiler.fs index 62fe50b9b70..5a2cbd7f65f 100644 --- a/src/Compiler/Service/BackgroundCompiler.fs +++ b/src/Compiler/Service/BackgroundCompiler.fs @@ -6,36 +6,22 @@ open FSharp.Compiler.BuildGraph open System open System.Diagnostics open System.IO -open System.Reflection -open System.Reflection.Emit open System.Threading open Internal.Utilities.Collections open Internal.Utilities.Library open Internal.Utilities.Library.Extras open FSharp.Compiler -open FSharp.Compiler.AbstractIL -open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.AbstractIL.ILBinaryReader -open FSharp.Compiler.AbstractIL.ILDynamicAssemblyWriter open FSharp.Compiler.CodeAnalysis open FSharp.Compiler.CompilerConfig -open FSharp.Compiler.CompilerDiagnostics open FSharp.Compiler.CompilerImports open FSharp.Compiler.CompilerOptions open FSharp.Compiler.DependencyManager open FSharp.Compiler.Diagnostics -open FSharp.Compiler.Driver -open FSharp.Compiler.DiagnosticsLogger -open FSharp.Compiler.IO open FSharp.Compiler.ParseAndCheckInputs open FSharp.Compiler.ScriptClosure open FSharp.Compiler.Symbols -open FSharp.Compiler.Syntax -open FSharp.Compiler.Tokenization -open FSharp.Compiler.Text -open FSharp.Compiler.Text.Range open FSharp.Compiler.TcGlobals -open FSharp.Compiler.BuildGraph open FSharp.Compiler.CodeAnalysis.ProjectSnapshot type SourceTextHash = int64 diff --git a/src/Compiler/Service/BackgroundCompiler.fsi b/src/Compiler/Service/BackgroundCompiler.fsi index 6192b23e3f9..30c008c2ed5 100644 --- a/src/Compiler/Service/BackgroundCompiler.fsi +++ b/src/Compiler/Service/BackgroundCompiler.fsi @@ -1,9 +1,6 @@ namespace FSharp.Compiler.CodeAnalysis open FSharp.Compiler.Text -open FSharp.Compiler.BuildGraph - -open System.Reflection open FSharp.Compiler.CodeAnalysis open FSharp.Compiler.CompilerConfig open FSharp.Compiler.Diagnostics diff --git a/src/Compiler/Service/FSharpCheckerResults.fs b/src/Compiler/Service/FSharpCheckerResults.fs index 5eefd6ef75c..7df88de24d3 100644 --- a/src/Compiler/Service/FSharpCheckerResults.fs +++ b/src/Compiler/Service/FSharpCheckerResults.fs @@ -9,7 +9,6 @@ open System open System.Collections.Generic open System.Diagnostics open System.IO -open System.Reflection open System.Threading open FSharp.Compiler.IO open FSharp.Compiler.NicePrint @@ -55,9 +54,6 @@ open FSharp.Compiler.TypedTreeOps open Internal.Utilities open Internal.Utilities.Collections open FSharp.Compiler.AbstractIL.ILBinaryReader -open System.Threading.Tasks -open System.Runtime.CompilerServices -open Internal.Utilities.Hashing type FSharpUnresolvedReferencesSet = FSharpUnresolvedReferencesSet of UnresolvedAssemblyReference list diff --git a/src/Compiler/Service/FSharpCheckerResults.fsi b/src/Compiler/Service/FSharpCheckerResults.fsi index fedc323859f..fe42a705b6c 100644 --- a/src/Compiler/Service/FSharpCheckerResults.fsi +++ b/src/Compiler/Service/FSharpCheckerResults.fsi @@ -3,10 +3,8 @@ namespace FSharp.Compiler.CodeAnalysis open System -open System.Collections.Generic open System.IO open System.Threading -open System.Threading.Tasks open Internal.Utilities.Library open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.AbstractIL.ILBinaryReader @@ -28,8 +26,6 @@ open FSharp.Compiler.TypedTreeOps open FSharp.Compiler.TcGlobals open FSharp.Compiler.Text -open Internal.Utilities.Collections - [] [] type DocumentSource = diff --git a/src/Compiler/Service/FSharpProjectSnapshot.fs b/src/Compiler/Service/FSharpProjectSnapshot.fs index 91a6efd472a..6e50e643293 100644 --- a/src/Compiler/Service/FSharpProjectSnapshot.fs +++ b/src/Compiler/Service/FSharpProjectSnapshot.fs @@ -5,7 +5,6 @@ module FSharp.Compiler.CodeAnalysis.ProjectSnapshot open System open System.Collections.Generic open System.IO -open System.Reflection open FSharp.Compiler.IO open Internal.Utilities.Library open Internal.Utilities.Library.Extras diff --git a/src/Compiler/Service/FSharpSource.fs b/src/Compiler/Service/FSharpSource.fs index fdcf70c28b9..bfdab00d690 100644 --- a/src/Compiler/Service/FSharpSource.fs +++ b/src/Compiler/Service/FSharpSource.fs @@ -4,7 +4,6 @@ namespace FSharp.Compiler.CodeAnalysis open System open System.IO -open Internal.Utilities.Library open FSharp.Compiler.IO open FSharp.Compiler.Text diff --git a/src/Compiler/Service/FSharpWorkspace.fs b/src/Compiler/Service/FSharpWorkspace.fs index 0b557386d07..5847968cd69 100644 --- a/src/Compiler/Service/FSharpWorkspace.fs +++ b/src/Compiler/Service/FSharpWorkspace.fs @@ -2,9 +2,6 @@ namespace FSharp.Compiler.CodeAnalysis.Workspace -open System.IO -open System.Threading - open FSharp.Compiler.CodeAnalysis open Internal.Utilities.DependencyGraph diff --git a/src/Compiler/Service/IncrementalBuild.fsi b/src/Compiler/Service/IncrementalBuild.fsi index 614792cad53..915f21196a7 100644 --- a/src/Compiler/Service/IncrementalBuild.fsi +++ b/src/Compiler/Service/IncrementalBuild.fsi @@ -3,7 +3,6 @@ namespace FSharp.Compiler.CodeAnalysis open System -open FSharp.Compiler open FSharp.Compiler.AbstractIL open FSharp.Compiler.CheckBasics open FSharp.Compiler.CheckDeclarations @@ -21,7 +20,6 @@ open FSharp.Compiler.Syntax open FSharp.Compiler.TcGlobals open FSharp.Compiler.Text open FSharp.Compiler.TypedTree -open FSharp.Compiler.BuildGraph open Internal.Utilities.Collections type internal FrameworkImportsCacheKey = diff --git a/src/Compiler/Service/ServiceLexing.fsi b/src/Compiler/Service/ServiceLexing.fsi index 869b295d338..7f2cc207ec0 100755 --- a/src/Compiler/Service/ServiceLexing.fsi +++ b/src/Compiler/Service/ServiceLexing.fsi @@ -6,7 +6,6 @@ open System open System.Threading open FSharp.Compiler open FSharp.Compiler.Text -open FSharp.Compiler.Features #nowarn "57" diff --git a/src/Compiler/Service/TransparentCompiler.fs b/src/Compiler/Service/TransparentCompiler.fs index 889749fc150..96c6738d001 100644 --- a/src/Compiler/Service/TransparentCompiler.fs +++ b/src/Compiler/Service/TransparentCompiler.fs @@ -13,7 +13,6 @@ open Internal.Utilities.Library open FSharp.Compiler open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.AbstractIL.ILBinaryReader -open FSharp.Compiler.BuildGraph open FSharp.Compiler.CodeAnalysis open FSharp.Compiler.CompilerConfig open FSharp.Compiler.CompilerImports @@ -39,7 +38,6 @@ open Internal.Utilities.Library.Extras open FSharp.Compiler.TypedTree open FSharp.Compiler.CheckDeclarations open FSharp.Compiler.EditorServices -open FSharp.Compiler.CodeAnalysis open FSharp.Compiler.CreateILModule open FSharp.Compiler.TypedTreeOps open System.Threading diff --git a/src/Compiler/Service/TransparentCompiler.fsi b/src/Compiler/Service/TransparentCompiler.fsi index 037b2ac89e7..8b99647304f 100644 --- a/src/Compiler/Service/TransparentCompiler.fsi +++ b/src/Compiler/Service/TransparentCompiler.fsi @@ -3,7 +3,6 @@ namespace FSharp.Compiler.CodeAnalysis.TransparentCompiler open Internal.Utilities.Collections open FSharp.Compiler.AbstractIL.ILBinaryReader -open FSharp.Compiler.BuildGraph open FSharp.Compiler.CodeAnalysis open FSharp.Compiler.CompilerConfig open FSharp.Compiler.CompilerImports diff --git a/src/Compiler/Service/service.fs b/src/Compiler/Service/service.fs index 7a013e1fd78..6af298d1b7b 100644 --- a/src/Compiler/Service/service.fs +++ b/src/Compiler/Service/service.fs @@ -3,39 +3,21 @@ namespace FSharp.Compiler.CodeAnalysis open System -open System.Diagnostics -open System.IO -open System.Reflection -open System.Reflection.Emit -open System.Threading open Internal.Utilities.Collections open Internal.Utilities.Library -open Internal.Utilities.Library.Extras open FSharp.Compiler -open FSharp.Compiler.AbstractIL -open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.AbstractIL.ILBinaryReader -open FSharp.Compiler.AbstractIL.ILDynamicAssemblyWriter open FSharp.Compiler.CodeAnalysis open FSharp.Compiler.CodeAnalysis.TransparentCompiler open FSharp.Compiler.CompilerConfig -open FSharp.Compiler.CompilerDiagnostics -open FSharp.Compiler.CompilerImports open FSharp.Compiler.CompilerOptions -open FSharp.Compiler.DependencyManager open FSharp.Compiler.Diagnostics open FSharp.Compiler.Driver open FSharp.Compiler.DiagnosticsLogger -open FSharp.Compiler.IO -open FSharp.Compiler.ParseAndCheckInputs -open FSharp.Compiler.ScriptClosure open FSharp.Compiler.Symbols -open FSharp.Compiler.Syntax open FSharp.Compiler.Tokenization open FSharp.Compiler.Text open FSharp.Compiler.Text.Range -open FSharp.Compiler.TcGlobals -open FSharp.Compiler.BuildGraph /// Callback that indicates whether a requested result has become obsolete. [] diff --git a/src/Compiler/Service/service.fsi b/src/Compiler/Service/service.fsi index 69ae46b16b5..2120cab1eef 100644 --- a/src/Compiler/Service/service.fsi +++ b/src/Compiler/Service/service.fsi @@ -5,17 +5,12 @@ namespace FSharp.Compiler.CodeAnalysis open System -open System.IO -open System.Threading -open System.Threading.Tasks open FSharp.Compiler.AbstractIL.ILBinaryReader open FSharp.Compiler.CodeAnalysis open FSharp.Compiler.CodeAnalysis.TransparentCompiler -open FSharp.Compiler.CompilerConfig open FSharp.Compiler.Diagnostics open FSharp.Compiler.EditorServices open FSharp.Compiler.Symbols -open FSharp.Compiler.Syntax open FSharp.Compiler.Text open FSharp.Compiler.Tokenization diff --git a/src/Compiler/Symbols/SymbolPatterns.fs b/src/Compiler/Symbols/SymbolPatterns.fs index 44b77965a28..c29b4709244 100644 --- a/src/Compiler/Symbols/SymbolPatterns.fs +++ b/src/Compiler/Symbols/SymbolPatterns.fs @@ -2,8 +2,6 @@ namespace FSharp.Compiler.Symbols -open System.Text.RegularExpressions -open Internal.Utilities.Library open FSharp.Compiler.Syntax /// Patterns over FSharpSymbol and derivatives. diff --git a/src/Compiler/SyntaxTree/LexHelpers.fs b/src/Compiler/SyntaxTree/LexHelpers.fs index a4c222720ac..c67aa134f84 100644 --- a/src/Compiler/SyntaxTree/LexHelpers.fs +++ b/src/Compiler/SyntaxTree/LexHelpers.fs @@ -6,7 +6,6 @@ open System open System.Text open Internal.Utilities -open Internal.Utilities.Library open Internal.Utilities.Text.Lexing open FSharp.Compiler.DiagnosticsLogger diff --git a/src/Compiler/SyntaxTree/ParseHelpers.fsi b/src/Compiler/SyntaxTree/ParseHelpers.fsi index 301e72e0ed7..f1b91b1f64f 100644 --- a/src/Compiler/SyntaxTree/ParseHelpers.fsi +++ b/src/Compiler/SyntaxTree/ParseHelpers.fsi @@ -7,7 +7,6 @@ open FSharp.Compiler.Syntax open FSharp.Compiler.SyntaxTrivia open FSharp.Compiler.Features open FSharp.Compiler.Text -open FSharp.Compiler.UnicodeLexing open FSharp.Compiler.Xml open Internal.Utilities.Text.Lexing open Internal.Utilities.Text.Parsing diff --git a/src/Compiler/TypedTree/TypedTree.fs b/src/Compiler/TypedTree/TypedTree.fs index 5ff4f37f556..f5191136852 100644 --- a/src/Compiler/TypedTree/TypedTree.fs +++ b/src/Compiler/TypedTree/TypedTree.fs @@ -7,8 +7,6 @@ open System open System.Collections.Generic open System.Collections.Immutable open System.Diagnostics -open System.Reflection - open Internal.Utilities.Collections open Internal.Utilities.Library open Internal.Utilities.Library.Extras diff --git a/src/Compiler/TypedTree/TypedTreeBasics.fsi b/src/Compiler/TypedTree/TypedTreeBasics.fsi index 6984d5c64fb..2b9372be3de 100644 --- a/src/Compiler/TypedTree/TypedTreeBasics.fsi +++ b/src/Compiler/TypedTree/TypedTreeBasics.fsi @@ -7,7 +7,6 @@ module internal FSharp.Compiler.TypedTreeBasics open Internal.Utilities.Library.Extras -open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.Syntax open FSharp.Compiler.Text open FSharp.Compiler.TypedTree diff --git a/src/Compiler/TypedTree/UpdatePrettyTyparNames.fs b/src/Compiler/TypedTree/UpdatePrettyTyparNames.fs index 614496a20d9..a2824d4c97d 100644 --- a/src/Compiler/TypedTree/UpdatePrettyTyparNames.fs +++ b/src/Compiler/TypedTree/UpdatePrettyTyparNames.fs @@ -3,7 +3,6 @@ /// In this module some helpers will traverse the ModuleOrNamespaceType and update all the typars of each found Val. module internal FSharp.Compiler.UpdatePrettyTyparNames -open Internal.Utilities.Library open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeOps diff --git a/src/Compiler/Utilities/Caches.fs b/src/Compiler/Utilities/Caches.fs index cae35a93015..210d1a83dfe 100644 --- a/src/Compiler/Utilities/Caches.fs +++ b/src/Compiler/Utilities/Caches.fs @@ -7,7 +7,6 @@ open System.Collections.Concurrent open System.Threading open System.Diagnostics open System.Diagnostics.Metrics -open System.IO module CacheMetrics = let Meter = FSharp.Compiler.Diagnostics.Metrics.Meter diff --git a/src/Compiler/Utilities/LruCache.fs b/src/Compiler/Utilities/LruCache.fs index 942b9acfc34..e2decd71735 100644 --- a/src/Compiler/Utilities/LruCache.fs +++ b/src/Compiler/Utilities/LruCache.fs @@ -7,7 +7,6 @@ open System.Collections.Generic open System.Diagnostics open Internal.Utilities.Library -open Internal.Utilities.Library.Extras [] type internal CacheEvent = diff --git a/src/Compiler/Utilities/PathMap.fs b/src/Compiler/Utilities/PathMap.fs index 50319ea7079..cf158a412b0 100644 --- a/src/Compiler/Utilities/PathMap.fs +++ b/src/Compiler/Utilities/PathMap.fs @@ -3,7 +3,6 @@ // Functions to map real paths to paths to be written to PDB/IL namespace Internal.Utilities -open System open System.IO open Internal.Utilities.Library diff --git a/src/Compiler/Utilities/TypeHashing.fs b/src/Compiler/Utilities/TypeHashing.fs index af536a9d2b6..f984a32d4e1 100644 --- a/src/Compiler/Utilities/TypeHashing.fs +++ b/src/Compiler/Utilities/TypeHashing.fs @@ -126,8 +126,6 @@ module HashAccessibility = | _ -> true module rec HashTypes = - open Microsoft.FSharp.Core.LanguagePrimitives - /// Hash a reference to a type let hashTyconRef tcref = hashTyconRefImpl tcref diff --git a/src/Compiler/Utilities/sformat.fsi b/src/Compiler/Utilities/sformat.fsi index af5b1e2f7d6..64f8d917a13 100644 --- a/src/Compiler/Utilities/sformat.fsi +++ b/src/Compiler/Utilities/sformat.fsi @@ -23,7 +23,6 @@ open System.IO open Microsoft.FSharp.Core open Microsoft.FSharp.Collections #if COMPILER -open Internal.Utilities.Library /// Data representing joints in structured layouts of terms. The representation /// of this data type is only for the consumption of formatting engines. diff --git a/src/FSharp.Core/Linq.fs b/src/FSharp.Core/Linq.fs index 06b84cd98d3..5793f99c596 100644 --- a/src/FSharp.Core/Linq.fs +++ b/src/FSharp.Core/Linq.fs @@ -6,11 +6,9 @@ open System open System.Collections.Generic open System.Linq.Expressions open System.Reflection -open Microsoft.FSharp open Microsoft.FSharp.Collections open Microsoft.FSharp.Core open Microsoft.FSharp.Linq -open Microsoft.FSharp.Core.Operators open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators open Microsoft.FSharp.Reflection open Microsoft.FSharp.Quotations diff --git a/src/FSharp.Core/MutableTuple.fs b/src/FSharp.Core/MutableTuple.fs index a9292f1c48b..0d3d4d998b0 100644 --- a/src/FSharp.Core/MutableTuple.fs +++ b/src/FSharp.Core/MutableTuple.fs @@ -3,8 +3,6 @@ namespace Microsoft.FSharp.Linq.RuntimeHelpers #nowarn "49" // no warning for uppercase variable names -open Microsoft.FSharp.Core - // ---------------------------------------------------------------------------- // Mutable Tuples - used when translating queries that use F# tuples // and records. We replace tuples/records with anonymous types which diff --git a/src/FSharp.Core/Query.fs b/src/FSharp.Core/Query.fs index 3211b3862bc..eb4a5100db1 100644 --- a/src/FSharp.Core/Query.fs +++ b/src/FSharp.Core/Query.fs @@ -9,7 +9,6 @@ open System.Collections.Generic open Microsoft.FSharp open Microsoft.FSharp.Core -open Microsoft.FSharp.Core.Operators open Microsoft.FSharp.Collections open Microsoft.FSharp.Quotations open Microsoft.FSharp.Linq.RuntimeHelpers @@ -286,12 +285,9 @@ open System.Collections open System.Collections.Generic open System.Linq.Expressions open System.Reflection -open Microsoft.FSharp open Microsoft.FSharp.Core -open Microsoft.FSharp.Core.Operators open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators open Microsoft.FSharp.Collections -open Microsoft.FSharp.Reflection open Microsoft.FSharp.Linq open Microsoft.FSharp.Linq.RuntimeHelpers.Adapters open Microsoft.FSharp.Linq.RuntimeHelpers diff --git a/src/FSharp.Core/QueryExtensions.fs b/src/FSharp.Core/QueryExtensions.fs index b6a682d0389..06a0ba19e0e 100644 --- a/src/FSharp.Core/QueryExtensions.fs +++ b/src/FSharp.Core/QueryExtensions.fs @@ -4,18 +4,15 @@ namespace Microsoft.FSharp.Linq.RuntimeHelpers open System open Microsoft.FSharp.Core -open Microsoft.FSharp.Core.Operators open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators open Microsoft.FSharp.Collections open Microsoft.FSharp.Quotations -open Microsoft.FSharp.Quotations.DerivedPatterns open Microsoft.FSharp.Reflection open Microsoft.FSharp.Linq.RuntimeHelpers open System.Collections open System.Collections.Concurrent open System.Collections.Generic open System.Linq -open System.Linq.Expressions open System.Reflection // ---------------------------------------------------------------------------- diff --git a/src/FSharp.Core/Random.fs b/src/FSharp.Core/Random.fs index 72c0c96c49b..0337daa8283 100644 --- a/src/FSharp.Core/Random.fs +++ b/src/FSharp.Core/Random.fs @@ -4,7 +4,6 @@ namespace Microsoft.FSharp.Core open System open System.Runtime.CompilerServices -open System.Threading [] type internal ThreadSafeRandom() = diff --git a/src/FSharp.Core/array.fs b/src/FSharp.Core/array.fs index 2c6dc792572..839fa705cb8 100644 --- a/src/FSharp.Core/array.fs +++ b/src/FSharp.Core/array.fs @@ -5,11 +5,9 @@ namespace Microsoft.FSharp.Collections //#nowarn "1118" // 'Make' marked 'inline', perhaps because a recursive value was marked 'inline' open System -open System.Diagnostics open System.Collections.Generic open Microsoft.FSharp.Core open Microsoft.FSharp.Collections -open Microsoft.FSharp.Core.Operators open Microsoft.FSharp.Core.CompilerServices open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators diff --git a/src/FSharp.Core/array.fsi b/src/FSharp.Core/array.fsi index 18a4463277e..65def57f048 100644 --- a/src/FSharp.Core/array.fsi +++ b/src/FSharp.Core/array.fsi @@ -5,7 +5,6 @@ namespace Microsoft.FSharp.Collections open System open Microsoft.FSharp.Core open Microsoft.FSharp.Collections -open System.Collections.Generic /// Contains operations for working with arrays. /// diff --git a/src/FSharp.Core/array2.fs b/src/FSharp.Core/array2.fs index 0b04b0b1ca0..76d20e74cfc 100644 --- a/src/FSharp.Core/array2.fs +++ b/src/FSharp.Core/array2.fs @@ -5,7 +5,6 @@ namespace Microsoft.FSharp.Collections open System open Microsoft.FSharp.Core open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators -open Microsoft.FSharp.Core.Operators open Microsoft.FSharp.Core.Operators.Checked #nowarn "3218" // mismatch of parameter name where 'count1' --> 'length1' would shadow function in module of same name diff --git a/src/FSharp.Core/array2.fsi b/src/FSharp.Core/array2.fsi index e64c92d32ba..6a497f32299 100644 --- a/src/FSharp.Core/array2.fsi +++ b/src/FSharp.Core/array2.fsi @@ -2,8 +2,6 @@ namespace Microsoft.FSharp.Collections -open System -open Microsoft.FSharp.Collections open Microsoft.FSharp.Core /// Contains operations for working with 2-dimensional arrays. diff --git a/src/FSharp.Core/array3.fs b/src/FSharp.Core/array3.fs index c92e46b8e57..f6139bf387d 100644 --- a/src/FSharp.Core/array3.fs +++ b/src/FSharp.Core/array3.fs @@ -2,10 +2,7 @@ namespace Microsoft.FSharp.Collections -open Microsoft.FSharp.Collections open Microsoft.FSharp.Core -open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators -open Microsoft.FSharp.Core.Operators open Microsoft.FSharp.Core.Operators.Checked [] diff --git a/src/FSharp.Core/array3.fsi b/src/FSharp.Core/array3.fsi index 12cc32419d2..f97ebb9869c 100644 --- a/src/FSharp.Core/array3.fsi +++ b/src/FSharp.Core/array3.fsi @@ -2,10 +2,7 @@ namespace Microsoft.FSharp.Collections -open System -open Microsoft.FSharp.Collections open Microsoft.FSharp.Core -open Microsoft.FSharp.Core.Operators /// Contains operations for working with rank 3 arrays. /// diff --git a/src/FSharp.Core/collections.fs b/src/FSharp.Core/collections.fs index 6287a09cd8e..6a52a10cde5 100644 --- a/src/FSharp.Core/collections.fs +++ b/src/FSharp.Core/collections.fs @@ -5,7 +5,6 @@ namespace Microsoft.FSharp.Collections #nowarn "51" open Microsoft.FSharp.Core -open Microsoft.FSharp.Core.Operators open System.Collections.Generic module HashIdentity = diff --git a/src/FSharp.Core/collections.fsi b/src/FSharp.Core/collections.fsi index 782de2a3364..c5ef4c130ef 100644 --- a/src/FSharp.Core/collections.fsi +++ b/src/FSharp.Core/collections.fsi @@ -4,9 +4,6 @@ namespace Microsoft.FSharp.Collections open Microsoft.FSharp.Core -open Microsoft.FSharp.Collections -open Microsoft.FSharp.Primitives.Basics -open System open System.Collections.Generic /// Common notions of value ordering implementing the diff --git a/src/FSharp.Core/event.fs b/src/FSharp.Core/event.fs index 999327c2e0e..974ce443c85 100644 --- a/src/FSharp.Core/event.fs +++ b/src/FSharp.Core/event.fs @@ -3,13 +3,10 @@ namespace Microsoft.FSharp.Control open Microsoft.FSharp.Core -open Microsoft.FSharp.Core.LanguagePrimitives open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators -open Microsoft.FSharp.Core.Operators open Microsoft.FSharp.Collections open Microsoft.FSharp.Control open System -open System.Diagnostics open System.Reflection module private Atomic = diff --git a/src/FSharp.Core/event.fsi b/src/FSharp.Core/event.fsi index 39e229ba357..1d3a748aa7c 100644 --- a/src/FSharp.Core/event.fsi +++ b/src/FSharp.Core/event.fsi @@ -4,9 +4,7 @@ namespace Microsoft.FSharp.Control open System open Microsoft.FSharp.Core -open Microsoft.FSharp.Core.Operators open Microsoft.FSharp.Control -open Microsoft.FSharp.Collections /// Event implementations for an arbitrary type of delegate. /// diff --git a/src/FSharp.Core/fslib-extra-pervasives.fs b/src/FSharp.Core/fslib-extra-pervasives.fs index 62ca55ac051..3bded43b24c 100644 --- a/src/FSharp.Core/fslib-extra-pervasives.fs +++ b/src/FSharp.Core/fslib-extra-pervasives.fs @@ -8,13 +8,10 @@ module ExtraTopLevelOperators = open System.Collections.Generic open System.IO open System.Diagnostics - open Microsoft.FSharp open Microsoft.FSharp.Core - open Microsoft.FSharp.Core.Operators open Microsoft.FSharp.Collections open Microsoft.FSharp.Control open Microsoft.FSharp.Linq - open Microsoft.FSharp.Primitives.Basics open Microsoft.FSharp.Core.CompilerServices let inline checkNonNullNullArg argName arg = diff --git a/src/FSharp.Core/fslib-extra-pervasives.fsi b/src/FSharp.Core/fslib-extra-pervasives.fsi index 1960408c727..f74aefdc252 100644 --- a/src/FSharp.Core/fslib-extra-pervasives.fsi +++ b/src/FSharp.Core/fslib-extra-pervasives.fsi @@ -13,7 +13,6 @@ module ExtraTopLevelOperators = open Microsoft.FSharp.Core open Microsoft.FSharp.Control open Microsoft.FSharp.Collections - open Microsoft.FSharp.Control open Microsoft.FSharp.Linq open Microsoft.FSharp.Quotations diff --git a/src/FSharp.Core/list.fs b/src/FSharp.Core/list.fs index 73adbdb3aac..eba1d0548a5 100644 --- a/src/FSharp.Core/list.fs +++ b/src/FSharp.Core/list.fs @@ -4,7 +4,6 @@ namespace Microsoft.FSharp.Collections open System open Microsoft.FSharp.Core -open Microsoft.FSharp.Core.Operators open Microsoft.FSharp.Core.LanguagePrimitives open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators open Microsoft.FSharp.Collections diff --git a/src/FSharp.Core/list.fsi b/src/FSharp.Core/list.fsi index 953014da50c..1b48f6d9c60 100644 --- a/src/FSharp.Core/list.fsi +++ b/src/FSharp.Core/list.fsi @@ -3,7 +3,6 @@ namespace Microsoft.FSharp.Collections open System -open System.Collections.Generic open Microsoft.FSharp.Core open Microsoft.FSharp.Collections diff --git a/src/FSharp.Core/local.fs b/src/FSharp.Core/local.fs index faf590bb5b8..1433e6dbcda 100644 --- a/src/FSharp.Core/local.fs +++ b/src/FSharp.Core/local.fs @@ -82,8 +82,6 @@ namespace Microsoft.FSharp.Primitives.Basics open Microsoft.FSharp.Core open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators open Microsoft.FSharp.Collections -open Microsoft.FSharp.Core.Operators -open System.Diagnostics.CodeAnalysis open System.Collections.Generic diff --git a/src/FSharp.Core/math/z.fs b/src/FSharp.Core/math/z.fs index bb84950492d..e557f3905c9 100644 --- a/src/FSharp.Core/math/z.fs +++ b/src/FSharp.Core/math/z.fs @@ -17,7 +17,6 @@ namespace Microsoft.FSharp.Core type bigint = System.Numerics.BigInteger open System -open System.Diagnostics.CodeAnalysis open System.Globalization open Microsoft.FSharp.Core.Operators open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators diff --git a/src/FSharp.Core/math/z.fsi b/src/FSharp.Core/math/z.fsi index 9c2261ff5b6..009bbaa7b4b 100644 --- a/src/FSharp.Core/math/z.fsi +++ b/src/FSharp.Core/math/z.fsi @@ -25,8 +25,6 @@ module NumericLiterals = /// Provides a default implementations of F# numeric literal syntax for literals of the form 'dddI' module NumericLiteralI = - open System.Numerics - /// Provides a default implementations of F# numeric literal syntax for literals of the form 'dddI' val FromZero: value: unit -> 'T diff --git a/src/FSharp.Core/nativeptr.fs b/src/FSharp.Core/nativeptr.fs index ba5d7b162a3..718b9079984 100644 --- a/src/FSharp.Core/nativeptr.fs +++ b/src/FSharp.Core/nativeptr.fs @@ -3,14 +3,6 @@ namespace Microsoft.FSharp.NativeInterop open Microsoft.FSharp.Core -open Microsoft.FSharp.Collections -open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators -open Microsoft.FSharp.Primitives.Basics -open Microsoft.FSharp.Core.Operators - -open System -open System.Diagnostics -open System.Runtime.InteropServices [] [] diff --git a/src/FSharp.Core/nativeptr.fsi b/src/FSharp.Core/nativeptr.fsi index 75ad378acfe..2f380f85dae 100644 --- a/src/FSharp.Core/nativeptr.fsi +++ b/src/FSharp.Core/nativeptr.fsi @@ -3,7 +3,6 @@ namespace Microsoft.FSharp.NativeInterop open Microsoft.FSharp.Core -open Microsoft.FSharp.Collections /// Contains operations on native pointers. Use of these operators may /// result in the generation of unverifiable code. diff --git a/src/FSharp.Core/prim-types.fs b/src/FSharp.Core/prim-types.fs index e884728d51e..fe725dd4c67 100644 --- a/src/FSharp.Core/prim-types.fs +++ b/src/FSharp.Core/prim-types.fs @@ -15,12 +15,7 @@ namespace Microsoft.FSharp.Core open System - open System.Collections open System.Collections.Generic - open System.Diagnostics - open System.Globalization - open System.Reflection - open System.Text type Unit() = override _.GetHashCode() = 0 @@ -452,11 +447,9 @@ namespace Microsoft.FSharp.Core open System open System.Collections open System.Collections.Generic - open System.Diagnostics open System.Globalization open System.Reflection - open System.Text -#endif + #endif [] type float<[] 'Measure> = float [] type float32<[] 'Measure> = float32 @@ -3706,15 +3699,9 @@ namespace Microsoft.FSharp.Core namespace Microsoft.FSharp.Core open System - open System.Collections - open System.Collections.Generic open System.Diagnostics - open System.Globalization - open System.Text open Microsoft.FSharp.Core.BasicInlinedOperations open Microsoft.FSharp.Core.LanguagePrimitives - open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators - open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicFunctions [] [] @@ -4133,7 +4120,6 @@ namespace Microsoft.FSharp.Collections open System.Diagnostics open Microsoft.FSharp.Core open Microsoft.FSharp.Core.LanguagePrimitives - open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicFunctions open Microsoft.FSharp.Core.BasicInlinedOperations @@ -4391,7 +4377,6 @@ namespace Microsoft.FSharp.Collections namespace Microsoft.FSharp.Core open System - open System.Diagnostics open System.Collections.Generic open System.Globalization open System.Text @@ -7308,9 +7293,7 @@ namespace Microsoft.FSharp.Core namespace Microsoft.FSharp.Control - open System - open System.Threading - open System.Diagnostics + open System open Microsoft.FSharp.Core open Microsoft.FSharp.Core.Operators diff --git a/src/FSharp.Core/printf.fs b/src/FSharp.Core/printf.fs index 69679baea38..d16e422117b 100644 --- a/src/FSharp.Core/printf.fs +++ b/src/FSharp.Core/printf.fs @@ -12,7 +12,6 @@ open System.Globalization open System.Reflection open Microsoft.FSharp.Core -open Microsoft.FSharp.Core.Operators open Microsoft.FSharp.Collections open LanguagePrimitives.IntrinsicOperators diff --git a/src/FSharp.Core/printf.fsi b/src/FSharp.Core/printf.fsi index fbcab429d01..022c767d3f9 100644 --- a/src/FSharp.Core/printf.fsi +++ b/src/FSharp.Core/printf.fsi @@ -4,7 +4,6 @@ namespace Microsoft.FSharp.Core open Microsoft.FSharp.Core -open Microsoft.FSharp.Collections open System open System.IO open System.Text diff --git a/src/FSharp.Core/quotations.fs b/src/FSharp.Core/quotations.fs index 1d7e0c91024..7d16efc2146 100644 --- a/src/FSharp.Core/quotations.fs +++ b/src/FSharp.Core/quotations.fs @@ -9,8 +9,6 @@ open System.Collections.Generic open Microsoft.FSharp open Microsoft.FSharp.Core open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators -open Microsoft.FSharp.Core.Operators -open Microsoft.FSharp.Primitives.Basics open Microsoft.FSharp.Collections open Microsoft.FSharp.Reflection open Microsoft.FSharp.Core.Printf @@ -2713,8 +2711,6 @@ type Expr with [] module DerivedPatterns = - open Patterns - [] let (|Bool|_|) input = match input with @@ -2910,8 +2906,6 @@ module DerivedPatterns = [] module ExprShape = - open Patterns - let RebuildShapeCombination (shape: objnull, arguments) = // preserve the attributes let op, attrs = unbox (shape) diff --git a/src/FSharp.Core/reflect.fs b/src/FSharp.Core/reflect.fs index 950f791f89c..997b075a3dd 100644 --- a/src/FSharp.Core/reflect.fs +++ b/src/FSharp.Core/reflect.fs @@ -9,7 +9,6 @@ open System open System.Collections.Generic open System.Reflection open Microsoft.FSharp.Core -open Microsoft.FSharp.Core.Operators open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators open Microsoft.FSharp.Collections open Microsoft.FSharp.Primitives.Basics diff --git a/src/FSharp.Core/reflect.fsi b/src/FSharp.Core/reflect.fsi index e4a5a546677..10c7be93188 100644 --- a/src/FSharp.Core/reflect.fsi +++ b/src/FSharp.Core/reflect.fsi @@ -8,8 +8,6 @@ open System open System.Reflection open System.Diagnostics.CodeAnalysis open Microsoft.FSharp.Core -open Microsoft.FSharp.Primitives.Basics -open Microsoft.FSharp.Collections /// Represents a case of a discriminated union type /// diff --git a/src/FSharp.Core/resumable.fs b/src/FSharp.Core/resumable.fs index 77a1dffd9ac..ca99f95201d 100644 --- a/src/FSharp.Core/resumable.fs +++ b/src/FSharp.Core/resumable.fs @@ -12,11 +12,7 @@ namespace Microsoft.FSharp.Core.CompilerServices open System open System.Runtime.CompilerServices open Microsoft.FSharp.Core -open Microsoft.FSharp.Core -open Microsoft.FSharp.Core.Printf -open Microsoft.FSharp.Core.CompilerServices open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators -open Microsoft.FSharp.Control open Microsoft.FSharp.Collections [] diff --git a/src/FSharp.Core/seq.fs b/src/FSharp.Core/seq.fs index 84c2c6245f2..d1a4ab48d5d 100644 --- a/src/FSharp.Core/seq.fs +++ b/src/FSharp.Core/seq.fs @@ -5,13 +5,11 @@ namespace Microsoft.FSharp.Collections #nowarn "52" // The value has been copied to ensure the original is not mutated by this operation open System -open System.Diagnostics open System.Collections open System.Collections.Generic open Microsoft.FSharp.Core open Microsoft.FSharp.Core.CompilerServices open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators -open Microsoft.FSharp.Core.Operators open Microsoft.FSharp.Control open Microsoft.FSharp.Collections open Microsoft.FSharp.Primitives.Basics diff --git a/src/FSharp.Core/seqcore.fs b/src/FSharp.Core/seqcore.fs index f78f0f75c9f..bf82c8eab56 100644 --- a/src/FSharp.Core/seqcore.fs +++ b/src/FSharp.Core/seqcore.fs @@ -9,10 +9,6 @@ open System.Diagnostics open System.Collections open System.Collections.Generic open Microsoft.FSharp.Core -open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators -open Microsoft.FSharp.Core.Operators -open Microsoft.FSharp.Control -open Microsoft.FSharp.Collections module internal IEnumerator = @@ -186,14 +182,12 @@ open System open System.Diagnostics open Microsoft.FSharp.Core open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators -open Microsoft.FSharp.Core.Operators open Microsoft.FSharp.Control open Microsoft.FSharp.Collections open Microsoft.FSharp.Collections.IEnumerator open Microsoft.FSharp.Primitives.Basics open System.Collections open System.Collections.Generic -open System.Runtime.CompilerServices module RuntimeHelpers = diff --git a/src/FSharp.Core/seqcore.fsi b/src/FSharp.Core/seqcore.fsi index 02d5ead9982..a93af1819d5 100644 --- a/src/FSharp.Core/seqcore.fsi +++ b/src/FSharp.Core/seqcore.fsi @@ -6,7 +6,6 @@ open System open System.Collections open System.Collections.Generic open Microsoft.FSharp.Core -open Microsoft.FSharp.Collections module internal IEnumerator = val noReset: unit -> 'a @@ -50,7 +49,6 @@ namespace Microsoft.FSharp.Core.CompilerServices open System open System.Collections open System.Collections.Generic -open System.Runtime.CompilerServices open Microsoft.FSharp.Core open Microsoft.FSharp.Collections diff --git a/src/FSharp.Core/set.fs b/src/FSharp.Core/set.fs index 0f3848569d3..bc8e833cc96 100644 --- a/src/FSharp.Core/set.fs +++ b/src/FSharp.Core/set.fs @@ -9,7 +9,6 @@ open System.Diagnostics open System.Text open Microsoft.FSharp.Core open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators -open Microsoft.FSharp.Core.Operators open Microsoft.FSharp.Collections // A functional language implementation of binary trees diff --git a/src/FSharp.Core/set.fsi b/src/FSharp.Core/set.fsi index 25a1988f4bc..c543506c75b 100644 --- a/src/FSharp.Core/set.fsi +++ b/src/FSharp.Core/set.fsi @@ -252,8 +252,6 @@ and [ Date: Wed, 15 Oct 2025 14:42:32 +0200 Subject: [PATCH 4/6] Fantomas --- src/Compiler/CodeGen/IlxGen.fs | 6 +---- src/Compiler/Service/BackgroundCompiler.fs | 15 +++-------- src/Compiler/Service/TransparentCompiler.fsi | 3 +-- src/Compiler/SyntaxTree/ParseHelpers.fs | 6 +---- src/Compiler/SyntaxTree/SyntaxTreeOps.fs | 16 +++--------- src/Compiler/SyntaxTree/SyntaxTreeOps.fsi | 3 +-- src/Compiler/TypedTree/TcGlobals.fsi | 26 +++++--------------- src/FSharp.Core/QueryExtensions.fs | 5 +--- src/FSharp.Core/array.fs | 2 +- src/FSharp.Core/async.fs | 12 ++------- src/FSharp.Core/event.fs | 4 +-- src/FSharp.Core/event.fsi | 3 +-- src/FSharp.Core/math/z.fs | 5 +--- 13 files changed, 25 insertions(+), 81 deletions(-) diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index 2db510ec3e0..77955988ebe 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -5710,11 +5710,7 @@ and GenGenericParam cenv eenv (tp: Typar) = | _ -> if nm.TrimEnd([| '0' .. '9' |]).Length = 1 then nm - elif - nm.Length >= 1 - && nm[0] = 'T' - && (nm.Length = 1 || not (Char.IsLower nm[1])) - then + elif nm.Length >= 1 && nm[0] = 'T' && (nm.Length = 1 || not (Char.IsLower nm[1])) then nm else "T" + (String.capitalize nm) diff --git a/src/Compiler/Service/BackgroundCompiler.fs b/src/Compiler/Service/BackgroundCompiler.fs index 5a2cbd7f65f..8c910806ede 100644 --- a/src/Compiler/Service/BackgroundCompiler.fs +++ b/src/Compiler/Service/BackgroundCompiler.fs @@ -64,24 +64,17 @@ type internal IBackgroundCompiler = abstract member DownsizeCaches: unit -> unit abstract member FindReferencesInFile: - fileName: string * - options: FSharpProjectOptions * - symbol: FSharpSymbol * - canInvalidateProject: bool * - userOpName: string -> + fileName: string * options: FSharpProjectOptions * symbol: FSharpSymbol * canInvalidateProject: bool * userOpName: string -> Async> abstract member FindReferencesInFile: - fileName: string * projectSnapshot: FSharpProjectSnapshot * symbol: FSharpSymbol * userOpName: string -> - Async> + fileName: string * projectSnapshot: FSharpProjectSnapshot * symbol: FSharpSymbol * userOpName: string -> Async> abstract member GetAssemblyData: - options: FSharpProjectOptions * outputFileName: string * userOpName: string -> - Async + options: FSharpProjectOptions * outputFileName: string * userOpName: string -> Async abstract member GetAssemblyData: - projectSnapshot: FSharpProjectSnapshot * outputFileName: string * userOpName: string -> - Async + projectSnapshot: FSharpProjectSnapshot * outputFileName: string * userOpName: string -> Async /// Fetch the check information from the background compiler (which checks w.r.t. the FileSystem API) abstract member GetBackgroundCheckResultsForFileInProject: diff --git a/src/Compiler/Service/TransparentCompiler.fsi b/src/Compiler/Service/TransparentCompiler.fsi index 8b99647304f..6792be3cdee 100644 --- a/src/Compiler/Service/TransparentCompiler.fsi +++ b/src/Compiler/Service/TransparentCompiler.fsi @@ -163,8 +163,7 @@ type internal CompilerCaches = member ParseAndCheckProject: AsyncMemoize - member ParseFile: - AsyncMemoize<(FSharpProjectIdentifier * string), (string * string * bool), FSharpParsedFile> + member ParseFile: AsyncMemoize<(FSharpProjectIdentifier * string), (string * string * bool), FSharpParsedFile> member ParseFileWithoutProject: AsyncMemoize diff --git a/src/Compiler/SyntaxTree/ParseHelpers.fs b/src/Compiler/SyntaxTree/ParseHelpers.fs index e1c4bbecebf..dcf905f7102 100644 --- a/src/Compiler/SyntaxTree/ParseHelpers.fs +++ b/src/Compiler/SyntaxTree/ParseHelpers.fs @@ -1142,11 +1142,7 @@ let mkLetExpression let mIn' = mIn - |> Option.bind (fun (mIn: range) -> - if posEq mIn.Start body.Range.Start then - None - else - Some mIn) + |> Option.bind (fun (mIn: range) -> if posEq mIn.Start body.Range.Start then None else Some mIn) let mLetOrUse = match decls with diff --git a/src/Compiler/SyntaxTree/SyntaxTreeOps.fs b/src/Compiler/SyntaxTree/SyntaxTreeOps.fs index de86ebef627..aca54b53f04 100644 --- a/src/Compiler/SyntaxTree/SyntaxTreeOps.fs +++ b/src/Compiler/SyntaxTree/SyntaxTreeOps.fs @@ -1132,11 +1132,7 @@ let (|MultiDimensionArrayType|_|) (t: SynType) = | SynType.App(StripParenTypes(SynType.LongIdent(SynLongIdent([ identifier ], _, _))), _, [ elementType ], _, _, true, m) -> if System.Text.RegularExpressions.Regex.IsMatch(identifier.idText, "^array\d\d?d$") then let rank = - identifier.idText - |> Seq.filter Char.IsDigit - |> Seq.toArray - |> String - |> int + identifier.idText |> Seq.filter Char.IsDigit |> Seq.toArray |> String |> int ValueSome(rank, elementType, m) else @@ -1169,10 +1165,7 @@ let getGetterSetterAccess synValSigAccess memberKind (langVersion: LanguageVersi errorR (Error(FSComp.SR.parsMultipleAccessibilitiesForGetSet (), x.Range)) None | Some x, None -> - checkLanguageFeatureAndRecover - langVersion - LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters - x.Range + checkLanguageFeatureAndRecover langVersion LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters x.Range accessBeforeGetSet @@ -1182,10 +1175,7 @@ let getGetterSetterAccess synValSigAccess memberKind (langVersion: LanguageVersi | _, (None, None) -> access, access | None, (Some x, _) | None, (_, Some x) -> - checkLanguageFeatureAndRecover - langVersion - LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters - x.Range + checkLanguageFeatureAndRecover langVersion LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters x.Range getterAccess, setterAccess | _, (Some x, _) diff --git a/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi b/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi index 43c59628e35..5e3d2ff13e3 100644 --- a/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi @@ -374,8 +374,7 @@ val (|TypesForTypar|): t: SynType -> SynType list [] val (|Get_OrSet_Ident|_|): Ident -> unit voption -val getGetterSetterAccess: - SynValSigAccess -> SynMemberKind -> LanguageVersion -> SynAccess option * SynAccess option +val getGetterSetterAccess: SynValSigAccess -> SynMemberKind -> LanguageVersion -> SynAccess option * SynAccess option /// Adds SynPat.Or pattern for unfinished empty clause above val addEmptyMatchClause: mBar1: range -> mBar2: range -> clauses: SynMatchClause list -> SynMatchClause list diff --git a/src/Compiler/TypedTree/TcGlobals.fsi b/src/Compiler/TypedTree/TcGlobals.fsi index 236572e2457..a1d772e8438 100644 --- a/src/Compiler/TypedTree/TcGlobals.fsi +++ b/src/Compiler/TypedTree/TcGlobals.fsi @@ -16,12 +16,7 @@ val internal DummyFileNameForRangesWithoutASpecificLocation: string /// Represents an intrinsic value from FSharp.Core known to the compiler [] type internal IntrinsicValRef = - | IntrinsicValRef of - TypedTree.NonLocalEntityRef * - string * - bool * - TypedTree.TType * - TypedTree.ValLinkageFullKey + | IntrinsicValRef of TypedTree.NonLocalEntityRef * string * bool * TypedTree.TType * TypedTree.ValLinkageFullKey /// For debugging override ToString: unit -> string @@ -200,8 +195,7 @@ type internal TcGlobals = /// Find an FSharp.Core LanguagePrimitives dynamic function that corresponds to a trait witness, e.g. /// AdditionDynamic for op_Addition. Also work out the type instantiation of the dynamic function. - member MakeBuiltInWitnessInfo: - t: TypedTree.TraitConstraintInfo -> IntrinsicValRef * TypedTree.TType list + member MakeBuiltInWitnessInfo: t: TypedTree.TraitConstraintInfo -> IntrinsicValRef * TypedTree.TType list member MakeInternalsVisibleToAttribute: simpleAssemName: string -> FSharp.Compiler.AbstractIL.IL.ILAttribute @@ -228,14 +222,10 @@ type internal TcGlobals = (IntrinsicValRef * TypedTree.TType list * 'a list) option member decompileType: - tcref: TypedTree.EntityRef -> - tinst: TypedTree.TypeInst -> - (TypedTree.Nullness -> TypedTree.TType) + tcref: TypedTree.EntityRef -> tinst: TypedTree.TypeInst -> (TypedTree.Nullness -> TypedTree.TType) member improveType: - tcref: TypedTree.EntityRef -> - tinst: TypedTree.TType list -> - (TypedTree.Nullness -> TypedTree.TType) + tcref: TypedTree.EntityRef -> tinst: TypedTree.TType list -> (TypedTree.Nullness -> TypedTree.TType) /// Memoization table to help minimize the number of ILSourceDocument objects we create member memoize_file: x: int -> FSharp.Compiler.AbstractIL.IL.ILSourceDocument @@ -257,8 +247,7 @@ type internal TcGlobals = member tryRemoveEmbeddedILTypeDefs: unit -> FSharp.Compiler.AbstractIL.IL.ILTypeDef list - member unionCaseRefEq: - x: TypedTree.UnionCaseRef -> y: TypedTree.UnionCaseRef -> bool + member unionCaseRefEq: x: TypedTree.UnionCaseRef -> y: TypedTree.UnionCaseRef -> bool member valRefEq: x: TypedTree.ValRef -> y: TypedTree.ValRef -> bool @@ -839,10 +828,7 @@ type internal TcGlobals = member knownFSharpCoreModules: System.Collections.Generic.IDictionary member knownIntrinsics: - System.Collections.Concurrent.ConcurrentDictionary< - (string * string option * string * int), - TypedTree.ValRef - > + System.Collections.Concurrent.ConcurrentDictionary<(string * string option * string * int), TypedTree.ValRef> member knownWithNull: TypedTree.Nullness diff --git a/src/FSharp.Core/QueryExtensions.fs b/src/FSharp.Core/QueryExtensions.fs index 06a0ba19e0e..e4fe4c20ff5 100644 --- a/src/FSharp.Core/QueryExtensions.fs +++ b/src/FSharp.Core/QueryExtensions.fs @@ -190,10 +190,7 @@ module internal Adapters = match expr with | Patterns.PropertyGet(Some(Patterns.NewRecord(typ, els)), propInfo, []) -> let fields = - FSharpType.GetRecordFields( - typ, - BindingFlags.Public ||| BindingFlags.NonPublic - ) + FSharpType.GetRecordFields(typ, BindingFlags.Public ||| BindingFlags.NonPublic) match fields |> Array.tryFindIndex (fun p -> p = propInfo) with | None -> None diff --git a/src/FSharp.Core/array.fs b/src/FSharp.Core/array.fs index 839fa705cb8..979d0f7ab2e 100644 --- a/src/FSharp.Core/array.fs +++ b/src/FSharp.Core/array.fs @@ -2462,7 +2462,7 @@ module Array = concurrencyLevel = maxPartitions, capacity = Operators.min (array.Length) 1_000, comparer = comparer - ) + ) let valueFactory = Func<_, _>(fun _ -> ref 0) diff --git a/src/FSharp.Core/async.fs b/src/FSharp.Core/async.fs index 75cc3dedd4f..7e2371cd79a 100644 --- a/src/FSharp.Core/async.fs +++ b/src/FSharp.Core/async.fs @@ -1745,12 +1745,7 @@ type Async = let cancellationToken = defaultArg cancellationToken defaultCancellationTokenSource.Token - StartWithContinuations - cancellationToken - computation - continuation - exceptionContinuation - cancellationContinuation + StartWithContinuations cancellationToken computation continuation exceptionContinuation cancellationContinuation static member StartWithContinuations (computation: Async<'T>, continuation, exceptionContinuation, cancellationContinuation, ?cancellationToken) @@ -2049,10 +2044,7 @@ type Async = static member AsBeginEnd<'Arg, 'T> (computation: ('Arg -> Async<'T>)) // The 'Begin' member - : ('Arg * AsyncCallback * objnull -> IAsyncResult) * - (IAsyncResult -> 'T) * - (IAsyncResult -> unit) - = + : ('Arg * AsyncCallback * objnull -> IAsyncResult) * (IAsyncResult -> 'T) * (IAsyncResult -> unit) = let beginAction = fun (a1, callback, state) -> AsBeginEndHelpers.beginAction ((computation a1), callback, state) diff --git a/src/FSharp.Core/event.fs b/src/FSharp.Core/event.fs index 974ce443c85..819e8d10448 100644 --- a/src/FSharp.Core/event.fs +++ b/src/FSharp.Core/event.fs @@ -77,8 +77,8 @@ type EventDelegee<'Args>(observer: IObserver<'Args>) = type EventWrapper<'Delegate, 'Args> = delegate of 'Delegate * objnull * 'Args -> unit [] -type Event<'Delegate, 'Args - when 'Delegate: delegate<'Args, unit> and 'Delegate :> Delegate and 'Delegate: not struct>() = +type Event<'Delegate, 'Args when 'Delegate: delegate<'Args, unit> and 'Delegate :> Delegate and 'Delegate: not struct>() + = let mutable multicast: 'Delegate = Unchecked.defaultof<_> diff --git a/src/FSharp.Core/event.fsi b/src/FSharp.Core/event.fsi index 1d3a748aa7c..e29a1bf6035 100644 --- a/src/FSharp.Core/event.fsi +++ b/src/FSharp.Core/event.fsi @@ -32,8 +32,7 @@ type DelegateEvent<'Delegate when 'Delegate :> Delegate> = /// /// Events and Observables [] -type Event<'Delegate, 'Args - when 'Delegate: delegate<'Args, unit> and 'Delegate :> Delegate and 'Delegate: not struct> = +type Event<'Delegate, 'Args when 'Delegate: delegate<'Args, unit> and 'Delegate :> Delegate and 'Delegate: not struct> = /// Creates an event object suitable for delegate types following the standard .NET Framework convention of a first 'sender' argument. /// The created event. diff --git a/src/FSharp.Core/math/z.fs b/src/FSharp.Core/math/z.fs index e557f3905c9..a80792861d6 100644 --- a/src/FSharp.Core/math/z.fs +++ b/src/FSharp.Core/math/z.fs @@ -46,10 +46,7 @@ module NumericLiterals = FromInt64Dynamic(int64 x32) let inline isOX s = - not (String.IsNullOrEmpty(s)) - && s.Length > 2 - && s.[0] = '0' - && s.[1] = 'x' + not (String.IsNullOrEmpty(s)) && s.Length > 2 && s.[0] = '0' && s.[1] = 'x' let FromZero () : 'T = (get32 0 :?> 'T) when 'T: BigInteger = BigInteger.Zero From 09d68ee082b0fa21e5130c72122b4781c6d24228 Mon Sep 17 00:00:00 2001 From: Eugene Auduchinok Date: Wed, 15 Oct 2025 14:55:41 +0200 Subject: [PATCH 5/6] Cleanup: remove redundant parens --- src/Compiler/AbstractIL/il.fs | 36 +-- src/Compiler/AbstractIL/ilascii.fs | 12 +- src/Compiler/AbstractIL/ilmorph.fs | 4 +- src/Compiler/AbstractIL/ilnativeres.fs | 8 +- src/Compiler/AbstractIL/ilread.fs | 28 +- src/Compiler/AbstractIL/ilreflect.fs | 2 +- src/Compiler/AbstractIL/ilwrite.fs | 4 +- src/Compiler/AbstractIL/ilwritepdb.fs | 10 +- .../Checking/AugmentWithHashCompare.fs | 2 +- src/Compiler/Checking/CheckBasics.fs | 2 +- src/Compiler/Checking/CheckBasics.fsi | 2 +- src/Compiler/Checking/CheckDeclarations.fs | 4 +- src/Compiler/Checking/CheckFormatStrings.fs | 2 +- .../Checking/CheckRecordSyntaxHelpers.fs | 2 +- src/Compiler/Checking/ConstraintSolver.fs | 18 +- .../CheckComputationExpressions.fs | 32 +-- .../Checking/Expressions/CheckExpressions.fs | 38 +-- src/Compiler/Checking/InfoReader.fs | 4 +- src/Compiler/Checking/MethodCalls.fs | 6 +- src/Compiler/Checking/MethodOverrides.fs | 7 +- src/Compiler/Checking/NameResolution.fs | 22 +- src/Compiler/Checking/NicePrint.fs | 6 +- .../Checking/PatternMatchCompilation.fs | 15 +- src/Compiler/Checking/PostInferenceChecks.fs | 10 +- src/Compiler/Checking/SignatureConformance.fs | 2 +- src/Compiler/Checking/SignatureHash.fs | 2 +- src/Compiler/Checking/TypeHierarchy.fs | 4 +- src/Compiler/Checking/import.fs | 6 +- src/Compiler/Checking/infos.fs | 4 +- src/Compiler/CodeGen/EraseClosures.fs | 4 +- src/Compiler/CodeGen/EraseUnions.fs | 8 +- src/Compiler/CodeGen/IlxGen.fs | 52 ++-- src/Compiler/CodeGen/IlxGenSupport.fs | 14 +- .../AssemblyResolveHandler.fs | 4 +- .../DependencyManager/DependencyProvider.fs | 10 +- .../NativeDllResolveHandler.fs | 6 +- src/Compiler/Driver/CompilerConfig.fs | 4 +- src/Compiler/Driver/CompilerDiagnostics.fs | 10 +- src/Compiler/Driver/CompilerImports.fs | 18 +- src/Compiler/Driver/CompilerOptions.fs | 30 +- src/Compiler/Driver/CreateILModule.fs | 12 +- src/Compiler/Driver/FxResolver.fs | 8 +- src/Compiler/Driver/ParseAndCheckInputs.fs | 24 +- src/Compiler/Driver/ScriptClosure.fs | 2 +- src/Compiler/Driver/StaticLinking.fs | 4 +- src/Compiler/Driver/XmlDocFileWriter.fs | 2 +- src/Compiler/Driver/fsc.fs | 4 +- src/Compiler/Facilities/AsyncMemoize.fs | 2 +- src/Compiler/Facilities/AsyncMemoize.fsi | 2 +- .../Facilities/DiagnosticResolutionHints.fs | 2 +- src/Compiler/Facilities/DiagnosticsLogger.fs | 2 +- src/Compiler/Facilities/prim-lexing.fs | 2 +- src/Compiler/Facilities/prim-parsing.fs | 16 +- .../Interactive/FSharpInteractiveServer.fs | 4 +- src/Compiler/Interactive/fsi.fs | 104 +++---- src/Compiler/Interactive/fsihelp.fs | 2 +- src/Compiler/Optimize/LowerSequences.fs | 2 +- src/Compiler/Optimize/LowerStateMachines.fs | 2 +- src/Compiler/Optimize/Optimizer.fs | 6 +- src/Compiler/Service/FSharpCheckerResults.fs | 4 +- src/Compiler/Service/FSharpProjectSnapshot.fs | 24 +- src/Compiler/Service/FSharpWorkspaceState.fs | 42 ++- src/Compiler/Service/ItemKey.fs | 4 +- src/Compiler/Service/QuickParse.fs | 8 +- .../Service/ServiceCompilerDiagnostics.fs | 2 +- src/Compiler/Service/ServiceNavigation.fs | 20 +- src/Compiler/Service/ServiceParseTreeWalk.fs | 2 +- src/Compiler/Service/ServiceParsedInputOps.fs | 2 +- src/Compiler/Service/ServiceStructure.fs | 2 +- src/Compiler/Service/ServiceXmlDocParser.fs | 2 +- src/Compiler/Service/TransparentCompiler.fs | 10 +- src/Compiler/Service/TransparentCompiler.fsi | 26 +- src/Compiler/Service/service.fs | 2 +- src/Compiler/Symbols/FSharpDiagnostic.fs | 3 +- src/Compiler/Symbols/SymbolHelpers.fs | 4 +- src/Compiler/Symbols/Symbols.fs | 2 +- src/Compiler/SyntaxTree/LexFilter.fs | 22 +- src/Compiler/SyntaxTree/LexHelpers.fs | 4 +- src/Compiler/SyntaxTree/ParseHelpers.fs | 2 +- src/Compiler/SyntaxTree/PrettyNaming.fs | 2 +- src/Compiler/SyntaxTree/SyntaxTreeOps.fs | 8 +- src/Compiler/SyntaxTree/XmlDoc.fs | 10 +- src/Compiler/TypedTree/TcGlobals.fs | 2 +- src/Compiler/TypedTree/TcGlobals.fsi | 6 +- src/Compiler/TypedTree/TypeProviders.fs | 7 +- src/Compiler/TypedTree/TypeProviders.fsi | 2 +- src/Compiler/TypedTree/TypedTree.fs | 6 +- src/Compiler/TypedTree/TypedTree.fsi | 2 +- src/Compiler/TypedTree/TypedTreeOps.fs | 31 ++- src/Compiler/TypedTree/TypedTreeOps.fsi | 2 +- src/Compiler/TypedTree/TypedTreePickle.fs | 6 +- src/Compiler/Utilities/Activity.fs | 6 +- src/Compiler/Utilities/FileSystem.fs | 2 +- src/Compiler/Utilities/LruCache.fs | 2 +- src/Compiler/Utilities/TaggedCollections.fs | 16 +- src/Compiler/Utilities/TypeHashing.fs | 18 +- src/Compiler/Utilities/illib.fs | 8 +- src/Compiler/Utilities/lib.fsi | 2 +- src/Compiler/Utilities/sr.fs | 4 +- src/FSharp.Core/Linq.fs | 123 +++++---- src/FSharp.Core/Query.fs | 58 ++-- src/FSharp.Core/QueryExtensions.fs | 14 +- src/FSharp.Core/array.fs | 10 +- src/FSharp.Core/async.fs | 24 +- src/FSharp.Core/async.fsi | 2 +- src/FSharp.Core/collections.fs | 2 +- src/FSharp.Core/event.fs | 10 +- src/FSharp.Core/fslib-extra-pervasives.fs | 16 +- src/FSharp.Core/fslib-extra-pervasives.fsi | 2 +- src/FSharp.Core/local.fs | 6 +- src/FSharp.Core/mailbox.fs | 10 +- src/FSharp.Core/mailbox.fsi | 4 +- src/FSharp.Core/map.fs | 30 +- src/FSharp.Core/prim-types.fs | 257 +++++++++--------- src/FSharp.Core/prim-types.fsi | 16 +- src/FSharp.Core/printf.fs | 24 +- src/FSharp.Core/quotations.fs | 58 ++-- src/FSharp.Core/quotations.fsi | 6 +- src/FSharp.Core/reflect.fs | 38 +-- src/FSharp.Core/resumable.fs | 14 +- src/FSharp.Core/seq.fs | 6 +- src/FSharp.Core/seq.fsi | 4 +- src/FSharp.Core/seqcore.fs | 6 +- src/FSharp.Core/seqcore.fsi | 2 +- src/FSharp.Core/set.fs | 20 +- src/FSharp.Core/string.fs | 2 +- src/FSharp.Core/tasks.fs | 30 +- .../ExprTests.fs | 6 +- .../FSharpExprPatternsTests.fs | 2 +- .../HashIfExpression.fs | 2 +- .../ParserTests.fs | 2 +- .../ProductVersion.fs | 4 +- .../ProjectAnalysisTests.fs | 2 +- .../ScriptOptionsTests.fs | 2 +- .../ServiceUntypedParseTests.fs | 18 +- 135 files changed, 921 insertions(+), 896 deletions(-) diff --git a/src/Compiler/AbstractIL/il.fs b/src/Compiler/AbstractIL/il.fs index 2b3f984938f..b93340584db 100644 --- a/src/Compiler/AbstractIL/il.fs +++ b/src/Compiler/AbstractIL/il.fs @@ -82,7 +82,7 @@ let splitNameAt (nm: string) idx = if idx > last then failwith "splitNameAt: idx > last" - (nm.Substring(0, idx)), (if idx < last then nm.Substring(idx + 1, last - idx) else "") + nm.Substring(0, idx), (if idx < last then nm.Substring(idx + 1, last - idx) else "") let rec splitNamespaceAux (nm: string) = match nm.IndexOf '.' with @@ -770,13 +770,13 @@ type ILTypeRef = let isPrimaryY = isPrimary y let xApproxId = - if isPrimaryX && not (isPrimaryY) then + if isPrimaryX && not isPrimaryY then ILTypeRef.ComputeHash(primaryScopeRef, x.Enclosing, x.Name) else x.ApproxId let yApproxId = - if isPrimaryY && not (isPrimaryX) then + if isPrimaryY && not isPrimaryX then ILTypeRef.ComputeHash(primaryScopeRef, y.Enclosing, y.Name) else y.ApproxId @@ -2283,10 +2283,10 @@ type ILEventDef | Some attrs -> attrs) ) - member x.IsSpecialName = (x.Attributes &&& EventAttributes.SpecialName) <> enum<_> (0) + member x.IsSpecialName = (x.Attributes &&& EventAttributes.SpecialName) <> enum<_> 0 member x.IsRTSpecialName = - (x.Attributes &&& EventAttributes.RTSpecialName) <> enum<_> (0) + (x.Attributes &&& EventAttributes.RTSpecialName) <> enum<_> 0 /// For debugging [] @@ -2362,10 +2362,10 @@ type ILPropertyDef ) member x.IsSpecialName = - (x.Attributes &&& PropertyAttributes.SpecialName) <> enum<_> (0) + (x.Attributes &&& PropertyAttributes.SpecialName) <> enum<_> 0 member x.IsRTSpecialName = - (x.Attributes &&& PropertyAttributes.RTSpecialName) <> enum<_> (0) + (x.Attributes &&& PropertyAttributes.RTSpecialName) <> enum<_> 0 /// For debugging [] @@ -2387,7 +2387,7 @@ type ILPropertyDefs = let convertFieldAccess (ilMemberAccess: ILMemberAccess) = match ilMemberAccess with | ILMemberAccess.Assembly -> FieldAttributes.Assembly - | ILMemberAccess.CompilerControlled -> enum (0) + | ILMemberAccess.CompilerControlled -> enum 0 | ILMemberAccess.FamilyAndAssembly -> FieldAttributes.FamANDAssem | ILMemberAccess.FamilyOrAssembly -> FieldAttributes.FamORAssem | ILMemberAccess.Family -> FieldAttributes.Family @@ -2827,7 +2827,7 @@ type ILTypeDef events = defaultArg events x.Events, properties = defaultArg properties x.Properties, additionalFlags = defaultArg newAdditionalFlags additionalFlags, - customAttrs = defaultArg customAttrs (x.CustomAttrsStored) + customAttrs = defaultArg customAttrs x.CustomAttrsStored ) member x.CustomAttrs: ILAttributes = @@ -3016,7 +3016,7 @@ and [] ILExportedTypeOrForwarder = member x.Access = typeAccessOfFlags (int x.Attributes) - member x.IsForwarder = x.Attributes &&& enum (0x00200000) <> enum 0 + member x.IsForwarder = x.Attributes &&& enum 0x00200000 <> enum 0 member x.CustomAttrs = x.CustomAttrsStored.GetCustomAttrs x.MetadataIndex @@ -4255,7 +4255,7 @@ let mkTypeForwarder scopeRef name nested customAttrs access = { ScopeRef = scopeRef Name = name - Attributes = enum (0x00200000) ||| convertTypeAccessFlags access + Attributes = enum 0x00200000 ||| convertTypeAccessFlags access Nested = nested CustomAttrsStored = storeILCustomAttrs customAttrs MetadataIndex = NoMetadataIdx @@ -4292,7 +4292,7 @@ let mkILStorageCtorWithParamNames (preblock: ILInstr list, ty, extraParams, flds | Some x -> I_seqpoint x | None -> () yield! preblock - for (n, (_pnm, nm, fieldTy, _attrs)) in List.indexed flds do + for n, (_pnm, nm, fieldTy, _attrs) in List.indexed flds do mkLdarg0 mkLdarg (uint16 (n + 1)) mkNormalStfld (mkILFieldSpecInTy (ty, nm, fieldTy)) @@ -4302,7 +4302,7 @@ let mkILStorageCtorWithParamNames (preblock: ILInstr list, ty, extraParams, flds let fieldParams = [ - for (pnm, _, ty, attrs) in flds do + for pnm, _, ty, attrs in flds do let ilParam = mkILParamNamed (pnm, ty) let ilParam = @@ -5129,17 +5129,17 @@ type ILTypeSigParser(tstring: string) = drop () // step to the number // fetch the arity let arity = - while (int (here ()) >= (int ('0'))) - && (int (here ()) <= (int ('9'))) - && (int (peek ()) >= (int ('0'))) - && (int (peek ()) <= (int ('9'))) do + while (int (here ()) >= (int '0')) + && (int (here ()) <= (int '9')) + && (int (peek ()) >= (int '0')) + && (int (peek ()) <= (int '9')) do step () Int32.Parse(take ()) // skip the '[' drop () // get the specializations - typeName + "`" + (arity.ToString()), + typeName + "`" + arity.ToString(), Some [ for _i in 0 .. arity - 1 do diff --git a/src/Compiler/AbstractIL/ilascii.fs b/src/Compiler/AbstractIL/ilascii.fs index 92c481b0f90..52ef88d0313 100644 --- a/src/Compiler/AbstractIL/ilascii.fs +++ b/src/Compiler/AbstractIL/ilascii.fs @@ -216,8 +216,8 @@ let Int32Int32Instrs: Lazy> = let DoubleInstrs: Lazy> = lazy [ - [ "ldc"; "r4" ], (fun x -> (AI_ldc(DT_R4, x))) - [ "ldc"; "r8" ], (fun x -> (AI_ldc(DT_R8, x))) + [ "ldc"; "r4" ], (fun x -> AI_ldc(DT_R4, x)) + [ "ldc"; "r8" ], (fun x -> AI_ldc(DT_R8, x)) ] /// Table of parsing and pretty printing data for instructions. @@ -245,10 +245,10 @@ let TypeInstrs: Lazy> = let IntTypeInstrs: Lazy> = lazy [ - [ "ldelem"; "multi" ], (fun (x, y) -> (I_ldelem_any(ILArrayShape.FromRank x, y))) - [ "stelem"; "multi" ], (fun (x, y) -> (I_stelem_any(ILArrayShape.FromRank x, y))) - [ "newarr"; "multi" ], (fun (x, y) -> (I_newarr(ILArrayShape.FromRank x, y))) - [ "ldelema"; "multi" ], (fun (x, y) -> (I_ldelema(NormalAddress, false, ILArrayShape.FromRank x, y))) + [ "ldelem"; "multi" ], (fun (x, y) -> I_ldelem_any(ILArrayShape.FromRank x, y)) + [ "stelem"; "multi" ], (fun (x, y) -> I_stelem_any(ILArrayShape.FromRank x, y)) + [ "newarr"; "multi" ], (fun (x, y) -> I_newarr(ILArrayShape.FromRank x, y)) + [ "ldelema"; "multi" ], (fun (x, y) -> I_ldelema(NormalAddress, false, ILArrayShape.FromRank x, y)) ] /// Table of parsing and pretty printing data for instructions. diff --git a/src/Compiler/AbstractIL/ilmorph.fs b/src/Compiler/AbstractIL/ilmorph.fs index 37d2810dd39..31adf4a364a 100644 --- a/src/Compiler/AbstractIL/ilmorph.fs +++ b/src/Compiler/AbstractIL/ilmorph.fs @@ -89,7 +89,7 @@ let rec morphILTypeRefsInILType f x = and tspec_tref2tref f (tspec: ILTypeSpec) = mkILTySpec (f tspec.TypeRef, List.map (morphILTypeRefsInILType f) tspec.GenericArgs) -let rec ty_scoref2scoref_tyvar2ty ((_fscope, fTyvar) as fs) ty = +let rec ty_scoref2scoref_tyvar2ty (_fscope, fTyvar as fs) ty = match ty with | ILType.Ptr elemTy -> ILType.Ptr(ty_scoref2scoref_tyvar2ty fs elemTy) | ILType.FunctionPointer callsig -> ILType.FunctionPointer(callsig_scoref2scoref_tyvar2ty fs callsig) @@ -259,7 +259,7 @@ let morphILFieldDefs f (fdefs: ILFieldDefs) = let morphILTypeDefs isInKnownSet f (tdefs: ILTypeDefs) = let filtered (tdefs: ILTypeDef array) = // The key ensures that items in the Known Set are not duplicated everything else may be. - let mkKey (i, (td: ILTypeDef)) = + let mkKey (i, td: ILTypeDef) = if isInKnownSet td.Name then struct (0, td.Name) else diff --git a/src/Compiler/AbstractIL/ilnativeres.fs b/src/Compiler/AbstractIL/ilnativeres.fs index 2eb03ab674e..070157f67fd 100644 --- a/src/Compiler/AbstractIL/ilnativeres.fs +++ b/src/Compiler/AbstractIL/ilnativeres.fs @@ -105,7 +105,7 @@ type CvtResFile() = static member private ReadStringOrID(fhIn: BinaryReader) = let mutable (pstring: RESOURCE_STRING) = RESOURCE_STRING() - let mutable (firstWord: WCHAR) = (fhIn.ReadChar()) + let mutable (firstWord: WCHAR) = fhIn.ReadChar() if int firstWord = 0xFFFF then pstring.Ordinal <- fhIn.ReadUInt16() @@ -173,7 +173,7 @@ type SectionCharacteristics = type ResourceSection() = new(sectionBytes: byte[], relocations: uint32[]) as this = - (ResourceSection()) + ResourceSection() then Debug.Assert(sectionBytes :> obj <> Unchecked.defaultof<_>) @@ -433,7 +433,7 @@ type VersionHelper() = if not (Char.IsDigit elements[i].[idx]) then invalidFormat <- true - VersionHelper.TryGetValue((elements[i].Substring(0, idx)), ref values[i]) + VersionHelper.TryGetValue(elements[i].Substring(0, idx), ref values[i]) |> ignore breakLoop <- true @@ -1139,7 +1139,7 @@ type NativeResourceWriter() = else Unchecked.defaultof<_> dataWriter.WriteUInt32(uint32 virtualAddressBase + sizeOfDirectoryTree + 16u + uint32 dataWriter.Count) - let mutable (data: byte[]) = (List(r.Data)).ToArray() + let mutable (data: byte[]) = List(r.Data).ToArray() dataWriter.WriteUInt32(uint32 data.Length) dataWriter.WriteUInt32 r.CodePage dataWriter.WriteUInt32 0u diff --git a/src/Compiler/AbstractIL/ilread.fs b/src/Compiler/AbstractIL/ilread.fs index 35ba3903196..9aa2a2672ef 100644 --- a/src/Compiler/AbstractIL/ilread.fs +++ b/src/Compiler/AbstractIL/ilread.fs @@ -442,7 +442,7 @@ let sigptrGetBytes n (bytes: byte[]) sigptr = let sigptrGetString n bytes sigptr = let bytearray, sigptr = sigptrGetBytes n bytes sigptr - (Encoding.UTF8.GetString(bytearray, 0, bytearray.Length)), sigptr + Encoding.UTF8.GetString(bytearray, 0, bytearray.Length), sigptr // -------------------------------------------------------------------- // Now the tables of instructions @@ -609,11 +609,11 @@ let instrs () = i_ldind_ref, I_none_instr(mkLdind DT_REF) i_cpblk, I_none_instr(volatileOrUnalignedPrefix I_cpblk) i_initblk, I_none_instr(volatileOrUnalignedPrefix I_initblk) - i_ldc_i8, I_i64_instr(noPrefixes (fun x -> (AI_ldc(DT_I8, ILConst.I8 x)))) + i_ldc_i8, I_i64_instr(noPrefixes (fun x -> AI_ldc(DT_I8, ILConst.I8 x))) i_ldc_i4, I_i32_i32_instr(noPrefixes mkLdcInt32) i_ldc_i4_s, I_i32_i8_instr(noPrefixes mkLdcInt32) - i_ldc_r4, I_r4_instr(noPrefixes (fun x -> (AI_ldc(DT_R4, ILConst.R4 x)))) - i_ldc_r8, I_r8_instr(noPrefixes (fun x -> (AI_ldc(DT_R8, ILConst.R8 x)))) + i_ldc_r4, I_r4_instr(noPrefixes (fun x -> AI_ldc(DT_R4, ILConst.R4 x))) + i_ldc_r8, I_r8_instr(noPrefixes (fun x -> AI_ldc(DT_R8, ILConst.R8 x))) i_ldfld, I_field_instr(volatileOrUnalignedPrefix (fun (x, y) fspec -> I_ldfld(x, y, fspec))) i_stfld, I_field_instr(volatileOrUnalignedPrefix (fun (x, y) fspec -> I_stfld(x, y, fspec))) i_ldsfld, I_field_instr(volatilePrefix (fun x fspec -> I_ldsfld(x, fspec))) @@ -2217,7 +2217,7 @@ and typeDefReader ctxtH : ILTypeDefStored = ILTypeDef( name = nm, genericParams = typars, - attributes = enum (flags), + attributes = enum flags, layout = layout, nestedTypes = nested, implements = impls, @@ -2494,7 +2494,7 @@ and seekReadField ctxt mdv (numTypars, hasLayout) (idx: int) = ILFieldDef( name = nm, fieldType = readBlobHeapAsFieldSig ctxt numTypars typeIdx, - attributes = enum (flags), + attributes = enum flags, literalValue = (if (flags &&& 0x8000) = 0 then None @@ -2858,7 +2858,7 @@ and seekReadMemberRefAsMethodDataUncached ctxtH (MemberRefAsMspecIdx(numTypars, readBlobHeapAsMethodSig ctxt enclTy.GenericArgs.Length typeIdx let methInst = List.init genarity (fun n -> mkILTyvarTy (uint16 (numTypars + n))) - (VarArgMethodData(enclTy, cc, nm, argTys, varargs, retTy, methInst)) + VarArgMethodData(enclTy, cc, nm, argTys, varargs, retTy, methInst) and seekReadMemberRefAsMethDataNoVarArgs ctxt numTypars idx : MethodData = let (VarArgMethodData(enclTy, cc, nm, argTys, varargs, retTy, methInst)) = @@ -2867,7 +2867,7 @@ and seekReadMemberRefAsMethDataNoVarArgs ctxt numTypars idx : MethodData = if Option.isSome varargs then dprintf "ignoring sentinel and varargs in ILMethodDef token signature" - (MethodData(enclTy, cc, nm, argTys, retTy, methInst)) + MethodData(enclTy, cc, nm, argTys, retTy, methInst) and seekReadMethodSpecAsMethodData (ctxt: ILMetadataReader) numTypars idx = ctxt.seekReadMethodSpecAsMethodData (MethodSpecAsMspecIdx(numTypars, idx)) @@ -3045,8 +3045,8 @@ and seekReadMethod (ctxt: ILMetadataReader) mdv numTypars (idx: int) = ILMethodDef( name = nm, - attributes = enum (flags), - implAttributes = enum (implflags), + attributes = enum flags, + implAttributes = enum implflags, securityDeclsStored = ctxt.securityDeclsReader_MethodDef, isEntryPoint = isEntryPoint, genericParams = seekReadGenericParams ctxt numTypars (tomd_MethodDef, idx), @@ -3187,7 +3187,7 @@ and seekReadEvent ctxt mdv numTypars idx = ILEventDef( eventType = seekReadOptionalTypeDefOrRef ctxt numTypars AsObject typIdx, name = readStringHeap ctxt nameIdx, - attributes = enum (flags), + attributes = enum flags, addMethod = seekReadMethodSemantics ctxt (0x0008, TaggedIndex(hs_Event, idx)), removeMethod = seekReadMethodSemantics ctxt (0x0010, TaggedIndex(hs_Event, idx)), fireMethod = seekReadOptionalMethodSemantics ctxt (0x0020, TaggedIndex(hs_Event, idx)), @@ -3253,7 +3253,7 @@ and seekReadProperty ctxt mdv numTypars idx = ILPropertyDef( name = readStringHeap ctxt nameIdx, callingConv = cc2, - attributes = enum (flags), + attributes = enum flags, setMethod = setter, getMethod = getter, propertyType = retTy, @@ -3914,7 +3914,7 @@ and seekReadMethodRVA (pectxt: PEReader) (ctxt: ILMetadataReader) (nm, noinline, let sehClauses = let sehMap = Dictionary<_, _>(clauses.Length, HashIdentity.Structural) - for (kind, st1, sz1, st2, sz2, extra) in clauses do + for kind, st1, sz1, st2, sz2, extra in clauses do let tryStart = rawToLabel st1 let tryFinish = rawToLabel (st1 + sz1) let handlerStart = rawToLabel st2 @@ -4169,7 +4169,7 @@ and seekReadTopExportedTypes (ctxt: ILMetadataReader) = { ScopeRef = seekReadImplAsScopeRef ctxt mdv implIdx Name = readBlobHeapAsTypeName ctxt (nameIdx, namespaceIdx) - Attributes = enum (flags) + Attributes = enum flags Nested = seekReadNestedExportedTypes ctxt exported nested i CustomAttrsStored = ctxt.customAttrsReader_ExportedType MetadataIndex = i diff --git a/src/Compiler/AbstractIL/ilreflect.fs b/src/Compiler/AbstractIL/ilreflect.fs index b1ee41d012c..03a6f829d64 100644 --- a/src/Compiler/AbstractIL/ilreflect.fs +++ b/src/Compiler/AbstractIL/ilreflect.fs @@ -1990,7 +1990,7 @@ let buildFieldPass2 cenv tref (typB: TypeBuilder) emEnv (fdef: ILFieldDef) = delayedFieldInits = (fun () -> fieldB.SetConstant(initial.AsObject())) :: emEnv.delayedFieldInits } - fdef.Offset |> Option.iter (fieldB.SetOffset) + fdef.Offset |> Option.iter fieldB.SetOffset // custom attributes: done on pass 3 as they may reference attribute constructors generated on // pass 2. let fref = mkILFieldRef (tref, fdef.Name, fdef.FieldType) diff --git a/src/Compiler/AbstractIL/ilwrite.fs b/src/Compiler/AbstractIL/ilwrite.fs index 116e40d50d5..40254a11965 100644 --- a/src/Compiler/AbstractIL/ilwrite.fs +++ b/src/Compiler/AbstractIL/ilwrite.fs @@ -3740,7 +3740,7 @@ let writePdb ( try s.SignStream fs with exn -> - failwith ($"Warning: A call to SignFile failed ({exn.Message})") + failwith $"Warning: A call to SignFile failed ({exn.Message})" reportTime "Signing Image" // Now we've done the bulk of the binary, do the PDB file and fixup the binary. @@ -3996,7 +3996,7 @@ let writeBinaryAux (stream: Stream, options: options, modul, normalizeAssemblyRe generatePortablePdb options.embedAllSource options.embedSourceList options.sourceLink options.checksumAlgorithm pdbData options.pathMap if options.embeddedPDB then - let (uncompressedLength, contentId, stream, algorithmName, checkSum) = pdbInfo + let uncompressedLength, contentId, stream, algorithmName, checkSum = pdbInfo let compressedStream = compressPortablePdbStream stream Some (uncompressedLength, contentId, compressedStream, algorithmName, checkSum) else diff --git a/src/Compiler/AbstractIL/ilwritepdb.fs b/src/Compiler/AbstractIL/ilwritepdb.fs index 1f6834a2dab..7242bc4e9e7 100644 --- a/src/Compiler/AbstractIL/ilwritepdb.fs +++ b/src/Compiler/AbstractIL/ilwritepdb.fs @@ -228,13 +228,13 @@ let pdbMagicNumber = 0x4244504dL let pdbGetEmbeddedPdbDebugInfo (embeddedPdbChunk: BinaryChunk) (uncompressedLength: int64) (compressedStream: MemoryStream) = let iddPdbBuffer = let buffer = - Array.zeroCreate (sizeof + sizeof + int (compressedStream.Length)) + Array.zeroCreate (sizeof + sizeof + int compressedStream.Length) let offset, size = (0, sizeof) // Magic Number dword: 0x4244504dL Buffer.BlockCopy(i32AsBytes (int pdbMagicNumber), 0, buffer, offset, size) let offset, size = (offset + size, sizeof) // Uncompressed size Buffer.BlockCopy(i32AsBytes (int uncompressedLength), 0, buffer, offset, size) - let offset, size = (offset + size, int (compressedStream.Length)) // Uncompressed size + let offset, size = (offset + size, int compressedStream.Length) // Uncompressed size Buffer.BlockCopy(compressedStream.ToArray(), 0, buffer, offset, size) buffer @@ -321,7 +321,7 @@ let sortMethods info = let getRowCounts tableRowCounts = let builder = ImmutableArray.CreateBuilder(tableRowCounts |> Array.length) - tableRowCounts |> Seq.iter (builder.Add) + tableRowCounts |> Seq.iter builder.Add builder.MoveToImmutable() let scopeSorter (scope1: PdbMethodScope) (scope2: PdbMethodScope) = @@ -462,7 +462,7 @@ type PortablePdbGenerator fs.CopyTo ms metadata.AddCustomDebugInformation( - ModuleDefinitionHandle.op_Implicit (EntityHandle.ModuleDefinition), + ModuleDefinitionHandle.op_Implicit EntityHandle.ModuleDefinition, metadata.GetOrAddGuid sourceLinkId, metadata.GetOrAddBlob(ms.ToArray()) ) @@ -990,7 +990,7 @@ let rec pushShadowedLocals (stackGuard: StackGuard) (localsToPush: PdbLocalVar[] yield (scope.EndOffset, scope.EndOffset) |] - for ((_, a), (b, _)) in Array.pairwise gaps do + for (_, a), (b, _) in Array.pairwise gaps do if a < b then yield { scope with diff --git a/src/Compiler/Checking/AugmentWithHashCompare.fs b/src/Compiler/Checking/AugmentWithHashCompare.fs index b2e2eaf9be7..ac7d2800e16 100644 --- a/src/Compiler/Checking/AugmentWithHashCompare.fs +++ b/src/Compiler/Checking/AugmentWithHashCompare.fs @@ -1369,7 +1369,7 @@ let MakeValsForEqualityWithComparerAugmentation g (tcref: TyconRef) = mkValSpec g tcref ty vis (Some(mkIStructuralEquatableEqualsSlotSig g)) "Equals" (tps +-> (mkEqualsWithComparerTy g ty)) tupArg false let withEqualsExactWithComparer = - let vis = TAccess (updateSyntaxAccessForCompPath (vis.CompilationPaths) SyntaxAccess.Public) + let vis = TAccess (updateSyntaxAccessForCompPath vis.CompilationPaths SyntaxAccess.Public) mkValSpec g tcref diff --git a/src/Compiler/Checking/CheckBasics.fs b/src/Compiler/Checking/CheckBasics.fs index cc172081fed..d8fdd288af3 100644 --- a/src/Compiler/Checking/CheckBasics.fs +++ b/src/Compiler/Checking/CheckBasics.fs @@ -311,7 +311,7 @@ type TcFileState = diagnosticOptions: FSharpDiagnosticOptions - argInfoCache: ConcurrentDictionary<(string * range), ArgReprInfo> + argInfoCache: ConcurrentDictionary // forward call TcPat: WarnOnUpperFlag -> TcFileState -> TcEnv -> PrelimValReprInfo option -> TcPatValFlags -> TcPatLinearEnv -> TType -> SynPat -> (TcPatPhase2Input -> Pattern) * TcPatLinearEnv diff --git a/src/Compiler/Checking/CheckBasics.fsi b/src/Compiler/Checking/CheckBasics.fsi index c396283c071..0191cf018f2 100644 --- a/src/Compiler/Checking/CheckBasics.fsi +++ b/src/Compiler/Checking/CheckBasics.fsi @@ -272,7 +272,7 @@ type TcFileState = /// A cache for ArgReprInfos which get created multiple times for the same values /// Since they need to be later mutated with updates from signature files this should make sure /// we're always dealing with the same instance and the updates don't get lost - argInfoCache: ConcurrentDictionary<(string * range), ArgReprInfo> + argInfoCache: ConcurrentDictionary // forward call TcPat: diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index 7247049f9d4..c8dfc933fc3 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -4174,7 +4174,7 @@ module EstablishTypeDefinitionCores = // Generate the union augmentation values for all tycons. let withBaseValsAndSafeInitInfosAndUnionValues = (envMutRecPrelim, withBaseValsAndSafeInitInfos) ||> MutRecShapes.mapTyconsWithEnv (fun envForDecls (origInfo, tyconOpt, fixupFinalAttrs, info) -> - let (tyconCore, _, _) = origInfo + let tyconCore, _, _ = origInfo let (MutRecDefnsPhase1DataForTycon (isAtOriginalTyconDefn=isAtOriginalTyconDefn)) = tyconCore let vspecs = match tyconOpt with @@ -5279,7 +5279,7 @@ let rec TcModuleOrNamespaceElementNonMutRec (cenv: cenv) parent typeNames scopem return ([defn], [], []), env, env | SynModuleDecl.Types (typeDefs, m) -> - let typeDefs = typeDefs |> List.filter (function (SynTypeDefn(typeInfo = SynComponentInfo(longId = []))) -> false | _ -> true) + let typeDefs = typeDefs |> List.filter (function SynTypeDefn(typeInfo = SynComponentInfo(longId = [])) -> false | _ -> true) let scopem = unionRanges m scopem let mutRecDefns = typeDefs |> List.map MutRecShape.Tycon let mutRecDefnsChecked, envAfter = TcDeclarations.TcMutRecDefinitions cenv env parent typeNames tpenv m scopem None mutRecDefns false diff --git a/src/Compiler/Checking/CheckFormatStrings.fs b/src/Compiler/Checking/CheckFormatStrings.fs index 45d993f5143..2021888970f 100644 --- a/src/Compiler/Checking/CheckFormatStrings.fs +++ b/src/Compiler/Checking/CheckFormatStrings.fs @@ -459,7 +459,7 @@ let parseFormatStringInternal // residue of hole "...{n}..." in interpolated strings become %P(...) | 'P' when isInterpolated -> - let (code, message) = FSComp.SR.alwaysUseTypedStringInterpolation() + let code, message = FSComp.SR.alwaysUseTypedStringInterpolation() warning(DiagnosticWithText(code, message, m)) checkOtherFlags ch let i = requireAndSkipInterpolationHoleFormat (i+1) diff --git a/src/Compiler/Checking/CheckRecordSyntaxHelpers.fs b/src/Compiler/Checking/CheckRecordSyntaxHelpers.fs index 945523a1de2..3a44f2ac7a4 100644 --- a/src/Compiler/Checking/CheckRecordSyntaxHelpers.fs +++ b/src/Compiler/Checking/CheckRecordSyntaxHelpers.fs @@ -64,7 +64,7 @@ let TransformAstForNestedUpdates (cenv: TcFileState) (env: TcEnv) overallTy (lid let rec buildLid res (id: Ident) = function | [] -> res - | (h: Ident) :: t -> + | h: Ident :: t -> // Mark these hidden field accesses as synthetic so that they don't make it // into the name resolution sink. let h = ident (h.idText, h.idRange.MakeSynthetic()) diff --git a/src/Compiler/Checking/ConstraintSolver.fs b/src/Compiler/Checking/ConstraintSolver.fs index 7f4697daee3..8b633577c5a 100644 --- a/src/Compiler/Checking/ConstraintSolver.fs +++ b/src/Compiler/Checking/ConstraintSolver.fs @@ -288,7 +288,7 @@ type ConstraintSolverState = else this.PostInferenceChecksFinal.Add check - member this.PopPostInferenceCheck (preDefaults) = + member this.PopPostInferenceCheck preDefaults = if preDefaults then this.PostInferenceChecksPreDefaults.RemoveAt(this.PostInferenceChecksPreDefaults.Count-1) else @@ -791,9 +791,9 @@ let SimplifyMeasure g vars ms = let nonZeroVar = ListMeasureVarOccsWithNonZeroExponents ms let newms = ProdMeasures [ - for (c, e') in nonZeroCon do + for c, e' in nonZeroCon do Measure.RationalPower (Measure.Const(c, ms.Range), NegRational (DivRational e' e)) - for (v', e') in nonZeroVar do + for v', e' in nonZeroVar do if typarEq v v' then newvarExpr else @@ -1056,7 +1056,8 @@ and SolveNullnessEquiv (csenv: ConstraintSolverEnv) m2 (trace: OptionalTrace) ty | NullnessInfo.WithoutNull, NullnessInfo.WithoutNull -> CompleteD // Warn for 'strict "must pass null"` APIs like Option.ofObj | NullnessInfo.WithNull, NullnessInfo.WithoutNull when shouldWarnUselessNullCheck csenv -> - WarnD(Error(FSComp.SR.tcPassingWithoutNullToANullableExpectingFunc (csenv.SolverState.WarnWhenUsingWithoutNullOnAWithNullTarget.Value),m2)) + WarnD(Error(FSComp.SR.tcPassingWithoutNullToANullableExpectingFunc + csenv.SolverState.WarnWhenUsingWithoutNullOnAWithNullTarget.Value,m2)) // Allow expected of WithNull and actual of WithoutNull except for specially marked APIs (handled above) | NullnessInfo.WithNull, NullnessInfo.WithoutNull -> CompleteD | _ -> @@ -1091,7 +1092,8 @@ and SolveNullnessSubsumesNullness (csenv: ConstraintSolverEnv) m2 (trace: Option | NullnessInfo.WithoutNull, NullnessInfo.WithoutNull -> CompleteD // Warn for 'strict "must pass null"` APIs like Option.ofObj | NullnessInfo.WithNull, NullnessInfo.WithoutNull when shouldWarnUselessNullCheck csenv -> - WarnD(Error(FSComp.SR.tcPassingWithoutNullToANullableExpectingFunc (csenv.SolverState.WarnWhenUsingWithoutNullOnAWithNullTarget.Value),m2)) + WarnD(Error(FSComp.SR.tcPassingWithoutNullToANullableExpectingFunc + csenv.SolverState.WarnWhenUsingWithoutNullOnAWithNullTarget.Value,m2)) // Allow target of WithNull and actual of WithoutNull | NullnessInfo.WithNull, NullnessInfo.WithoutNull -> CompleteD @@ -1323,13 +1325,13 @@ and SolveTypeEqualsType (csenv: ConstraintSolverEnv) ndeep m2 (trace: OptionalTr } // Catch float<_>=float<1>, float32<_>=float32<1> and decimal<_>=decimal<1> - | (_, TType_app (tc2, [ms2], _)) when (tc2.IsMeasureableReprTycon && typeEquiv csenv.g sty1 (reduceTyconRefMeasureableOrProvided csenv.g tc2 [ms2])) -> + | _, TType_app (tc2, [ms2], _) when (tc2.IsMeasureableReprTycon && typeEquiv csenv.g sty1 (reduceTyconRefMeasureableOrProvided csenv.g tc2 [ms2])) -> trackErrors { do! SolveTypeEqualsType csenv ndeep m2 trace None (TType_measure(Measure.One m2)) ms2 do! SolveNullnessEquiv csenv m2 trace ty1 ty2 (nullnessOfTy g sty1) (nullnessOfTy g sty2) } - | (TType_app (tc1, [ms1], _), _) when (tc1.IsMeasureableReprTycon && typeEquiv csenv.g sty2 (reduceTyconRefMeasureableOrProvided csenv.g tc1 [ms1])) -> + | TType_app (tc1, [ms1], _), _ when (tc1.IsMeasureableReprTycon && typeEquiv csenv.g sty2 (reduceTyconRefMeasureableOrProvided csenv.g tc1 [ms1])) -> trackErrors { do! SolveTypeEqualsType csenv ndeep m2 trace None ms1 (TType_measure(Measure.One m2)) do! SolveNullnessEquiv csenv m2 trace ty1 ty2 (nullnessOfTy g sty1) (nullnessOfTy g sty2) @@ -2197,7 +2199,7 @@ and GetRelevantMethodsForTrait (csenv: ConstraintSolverEnv) (permitWeakResolutio let nominalTys = GetNominalSupportOfMemberConstraint csenv nm traitInfo let minfos = - [ for (supportTy, nominalTy) in nominalTys do + [ for supportTy, nominalTy in nominalTys do let infos = match traitInfo.MemberFlags.MemberKind with | SynMemberKind.Constructor -> diff --git a/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs b/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs index 64d1cc989be..9564a883fec 100644 --- a/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs +++ b/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs @@ -443,7 +443,7 @@ let customOpUsageText ceenv nm = ) ) elif isLikeZip then - Some(FSComp.SR.customOperationTextLikeZip (nm.idText)) + Some(FSComp.SR.customOperationTextLikeZip nm.idText) else None | _ -> None @@ -973,7 +973,7 @@ let rec TryTranslateComputationExpression (ceenv: ComputationExpressionContext<'a>) (firstTry: CompExprTranslationPass) (q: CustomOperationsMode) - (varSpace: LazyWithContext<(Val list * TcEnv), range>) + (varSpace: LazyWithContext) (comp: SynExpr) (translatedCtxt: SynExpr -> SynExpr) : SynExpr option = @@ -1061,14 +1061,14 @@ let rec TryTranslateComputationExpression SimplePatsOfPat cenv.synArgNameGenerator secondSourcePat if Option.isSome later1 then - errorR (Error(FSComp.SR.tcJoinMustUseSimplePattern (nm.idText), firstSourcePat.Range)) + errorR (Error(FSComp.SR.tcJoinMustUseSimplePattern nm.idText, firstSourcePat.Range)) if Option.isSome later2 then - errorR (Error(FSComp.SR.tcJoinMustUseSimplePattern (nm.idText), secondSourcePat.Range)) + errorR (Error(FSComp.SR.tcJoinMustUseSimplePattern nm.idText, secondSourcePat.Range)) // check 'join' or 'groupJoin' or 'zip' is permitted for this builder match tryGetDataForCustomOperation nm ceenv with - | None -> error (Error(FSComp.SR.tcMissingCustomOperation (nm.idText), nm.idRange)) + | None -> error (Error(FSComp.SR.tcMissingCustomOperation nm.idText, nm.idRange)) | Some opDatas -> let opName, _, _, _, _, _, _, _, methInfo = opDatas[0] @@ -1147,7 +1147,7 @@ let rec TryTranslateComputationExpression SimplePatsOfPat cenv.synArgNameGenerator secondResultPat if Option.isSome later3 then - errorR (Error(FSComp.SR.tcJoinMustUseSimplePattern (nm.idText), secondResultPat.Range)) + errorR (Error(FSComp.SR.tcJoinMustUseSimplePattern nm.idText, secondResultPat.Range)) match relExpr with | JoinRelation ceenv (keySelector1, keySelector2) -> @@ -1162,7 +1162,7 @@ let rec TryTranslateComputationExpression ) ) else - errorR (Error(FSComp.SR.tcInvalidRelationInJoin (nm.idText), relExpr.Range)) + errorR (Error(FSComp.SR.tcInvalidRelationInJoin nm.idText, relExpr.Range)) let l = wrapInArbErrSequence l "_keySelector1" let r = wrapInArbErrSequence r "_keySelector2" @@ -1170,7 +1170,7 @@ let rec TryTranslateComputationExpression // we've already reported error now we can use operands of binary operation as join components mkJoinExpr l r secondResultSimplePats, varSpaceWithGroupJoinVars | _ -> - errorR (Error(FSComp.SR.tcInvalidRelationInJoin (nm.idText), relExpr.Range)) + errorR (Error(FSComp.SR.tcInvalidRelationInJoin nm.idText, relExpr.Range)) // since the shape of relExpr doesn't match our expectations (JoinRelation) // then we assume that this is l.h.s. of the join relation // so typechecker will treat relExpr as body of outerKeySelector lambda parameter in GroupJoin method @@ -1191,14 +1191,14 @@ let rec TryTranslateComputationExpression ) ) else - errorR (Error(FSComp.SR.tcInvalidRelationInJoin (nm.idText), relExpr.Range)) + errorR (Error(FSComp.SR.tcInvalidRelationInJoin nm.idText, relExpr.Range)) // this is not correct JoinRelation but it is still binary operation // we've already reported error now we can use operands of binary operation as join components let l = wrapInArbErrSequence l "_keySelector1" let r = wrapInArbErrSequence r "_keySelector2" mkJoinExpr l r secondSourceSimplePats, varSpaceWithGroupJoinVars | _ -> - errorR (Error(FSComp.SR.tcInvalidRelationInJoin (nm.idText), relExpr.Range)) + errorR (Error(FSComp.SR.tcInvalidRelationInJoin nm.idText, relExpr.Range)) // since the shape of relExpr doesn't match our expectations (JoinRelation) // then we assume that this is l.h.s. of the join relation // so typechecker will treat relExpr as body of outerKeySelector lambda parameter in Join method @@ -1547,7 +1547,7 @@ let rec TryTranslateComputationExpression && equals mUnit range0 -> error (Error(FSComp.SR.tcEmptyBodyRequiresBuilderZeroMethod (), ceenv.mWhole)) - | _ -> error (Error(FSComp.SR.tcRequireBuilderMethod ("Zero"), m)) + | _ -> error (Error(FSComp.SR.tcRequireBuilderMethod "Zero", m)) Some(translatedCtxt (mkSynCall "Zero" m [] ceenv.builderValName)) @@ -1608,7 +1608,7 @@ let rec TryTranslateComputationExpression Some(TranslateComputationExpression ceenv CompExprTranslationPass.Initial q varSpace innerComp2 translatedCtxt) else - if ceenv.isQuery && not (innerComp1.IsArbExprAndThusAlreadyReportedError) then + if ceenv.isQuery && not innerComp1.IsArbExprAndThusAlreadyReportedError then match innerComp1 with | SynExpr.JoinIn _ -> () | SynExpr.DoBang(trivia = { DoBangKeyword = m }) -> errorR (Error(FSComp.SR.tcBindMayNotBeUsedInQueries (), m)) @@ -2095,7 +2095,7 @@ let rec TryTranslateComputationExpression loop 2 if maxMergeSources = 1 then - error (Error(FSComp.SR.tcRequireMergeSourcesOrBindN (bindNName), mBind)) + error (Error(FSComp.SR.tcRequireMergeSourcesOrBindN bindNName, mBind)) let rec mergeSources (sourcesAndPats: (SynExpr * SynPat) list) = let numSourcesAndPats = sourcesAndPats.Length @@ -2441,7 +2441,7 @@ and ConsumeCustomOpClauses match optionalIntoPat with | Some intoPat -> if not (customOperationAllowsInto ceenv nm) then - error (Error(FSComp.SR.tcOperatorDoesntAcceptInto (nm.idText), intoPat.Range)) + error (Error(FSComp.SR.tcOperatorDoesntAcceptInto nm.idText, intoPat.Range)) // Rebind using either for ... or let!.... let rebind = @@ -2750,7 +2750,7 @@ and TranslateComputationExpression (ceenv: ComputationExpressionContext<'a>) fir // This only occurs in final position in a sequence match comp with // "do! expr;" in tail call position is treated as { return! expr } when ReturnFromFinal is provided - | SynExpr.DoBang(rhsExpr, m, _) when ceenv.tailCall && ((hasBuilderMethod ceenv m "ReturnFromFinal")) -> + | SynExpr.DoBang(rhsExpr, m, _) when ceenv.tailCall && (hasBuilderMethod ceenv m "ReturnFromFinal") -> let returnFrom = // Flags indicate isTrueYield, isTrueReturn SynExpr.YieldOrReturnFrom((false, true), rhsExpr, m, SynExprYieldOrReturnFromTrivia.Zero) @@ -2758,7 +2758,7 @@ and TranslateComputationExpression (ceenv: ComputationExpressionContext<'a>) fir TranslateComputationExpression ceenv CompExprTranslationPass.Initial q varSpace returnFrom translatedCtxt // "do! expr;" in tail call position is treated as { yield! expr } when YieldFromFinal is provided - | SynExpr.DoBang(rhsExpr, m, _) when ceenv.tailCall && ((hasBuilderMethod ceenv m "YieldFromFinal")) -> + | SynExpr.DoBang(rhsExpr, m, _) when ceenv.tailCall && (hasBuilderMethod ceenv m "YieldFromFinal") -> let returnFrom = // Flags indicate isTrueYield, isTrueReturn SynExpr.YieldOrReturnFrom((true, false), rhsExpr, m, SynExprYieldOrReturnFromTrivia.Zero) diff --git a/src/Compiler/Checking/Expressions/CheckExpressions.fs b/src/Compiler/Checking/Expressions/CheckExpressions.fs index 44034ab2a6f..44dc174c7e3 100644 --- a/src/Compiler/Checking/Expressions/CheckExpressions.fs +++ b/src/Compiler/Checking/Expressions/CheckExpressions.fs @@ -1519,7 +1519,7 @@ let AdjustAndForgetUsesOfRecValue (cenv: cenv) (vrefTgt: ValRef) (valScheme: Val // Find all the uses of this recursive binding and use mutation to adjust the expressions // at those points in order to record the inferred type parameters. let recUses = cenv.recUses.Find lvrefTgt - for (fixupPoint, m, isComplete) in recUses do + for fixupPoint, m, isComplete in recUses do if not isComplete then // Keep any values for explicit type arguments let fixedUpExpr = @@ -3651,7 +3651,7 @@ let EliminateInitializationGraphs if mustHaveValReprInfo then vlazy.SetValReprInfo (Some(InferValReprInfoOfExpr g AllowTypeDirectedDetupling.Yes vTy [] [] vrhs)) - for (fixupPoint, _) in fixupPoints do + for fixupPoint, _ in fixupPoints do fixupPoint.Value <- mkLazyForce g fixupPoint.Value.Range ty velazy [mkInvisibleBind flazy frhs; mkInvisibleBind vlazy vrhs], @@ -4541,7 +4541,7 @@ and TcTypeOrMeasure kindOpt (cenv: cenv) newOk checkConstraints occ (iwsam: Warn | SynType.Or(range = m) -> // The inner types are expected to be collected by (|TypesForTypar|) at this point. - error(Error((FSComp.SR.tcSynTypeOrInvalidInDeclaration()), m)) + error(Error(FSComp.SR.tcSynTypeOrInvalidInDeclaration(), m)) | SynType.FromParseError _ -> NewErrorType (), tpenv @@ -5628,12 +5628,12 @@ and TcExprThenDynamic (cenv: cenv) overallTy env tpenv isArg e1 mQmark e2 delaye TcExprThen cenv overallTy env tpenv isArg appExpr delayed and TcExprsWithFlexes (cenv: cenv) env m tpenv flexes (argTys: TType list) (args: SynExpr list) = - if args.Length <> argTys.Length then error(Error(FSComp.SR.tcExpressionCountMisMatch((argTys.Length), (args.Length)), m)) + if args.Length <> argTys.Length then error(Error(FSComp.SR.tcExpressionCountMisMatch(argTys.Length, args.Length), m)) (tpenv, List.zip3 flexes argTys args) ||> List.mapFold (fun tpenv (flex, ty, e) -> TcExprFlex cenv flex false ty env tpenv e) and TcExprsNoFlexes (cenv: cenv) env m tpenv (argTys: TType list) (args: SynExpr list) = - if args.Length <> argTys.Length then error(Error(FSComp.SR.tcExpressionCountMisMatch((argTys.Length), (args.Length)), m)) + if args.Length <> argTys.Length then error(Error(FSComp.SR.tcExpressionCountMisMatch(argTys.Length, args.Length), m)) (tpenv, List.zip argTys args) ||> List.mapFold (fun tpenv (ty, e) -> TcExprFlex2 cenv ty env false tpenv e) @@ -6192,7 +6192,7 @@ and CheckTupleIsCorrectLength g (env: TcEnv) m tupleTy (args: 'a list) tcArgs = // We let error recovery handle this exception error (ErrorFromAddingTypeEquation(g, env.DisplayEnv, tupleTy, actualTy, - (ConstraintSolverTupleDiffLengths(env.DisplayEnv, env.eContextInfo, ptys, argTys, m, m)), m)) + ConstraintSolverTupleDiffLengths(env.DisplayEnv, env.eContextInfo, ptys, argTys, m, m), m)) and TcExprTuple (cenv: cenv) overallTy env tpenv (isExplicitStruct, args, m) = let g = cenv.g @@ -6491,7 +6491,7 @@ and TcIteratedLambdas (cenv: cenv) isFirst (env: TcEnv) overallTy takenNames tpe |> Option.map fst |> Option.defaultValue [] - let vs, (TcPatLinearEnv (tpenv, names, takenNames)) = + let vs, TcPatLinearEnv (tpenv, names, takenNames) = cenv.TcSimplePats cenv isMember CheckCxs domainTy env (TcPatLinearEnv (tpenv, Map.empty, takenNames)) synSimplePats (parsedPatterns, isFirst) let envinner, _, vspecMap = MakeAndPublishSimpleValsForMergedScope cenv env m names @@ -7298,7 +7298,7 @@ and TcObjectExpr (cenv: cenv) env tpenv (objTy, realObjTy, argopt, binds, extraI // 2. check usage conditions for ovd in overridesAndVirts do - let (m, implTy, dispatchSlots, dispatchSlotsKeyed, availPriorOverrides, overrides) = ovd + let m, implTy, dispatchSlots, dispatchSlotsKeyed, availPriorOverrides, overrides = ovd let overrideSpecs = overrides |> List.map fst let hasStaticMembers = dispatchSlots |> List.exists (fun reqdSlot -> not reqdSlot.MethodInfo.IsInstance) if hasStaticMembers then @@ -7403,7 +7403,7 @@ and TcFormatStringExpr cenv (overallTy: OverallTy) env m tpenv (fmtString: strin | Some sink, LiteralArgumentType.Inline -> sink.FormatStringCheckContext | _ -> None - let normalizedString = (fmtString.Replace("\r\n", "\n").Replace("\r", "\n")) + let normalizedString = fmtString.Replace("\r\n", "\n").Replace("\r", "\n") let _argTys, atyRequired, etyRequired, _percentATys, specifierLocations, _dotnetFormatString = try CheckFormatStrings.ParseFormatString m [m] g false false formatStringCheckContext normalizedString bty cty dty @@ -8116,7 +8116,7 @@ and TcForEachExpr cenv overallTy env tpenv (seqExprOnly, isFromSource, synPat, s let tcVal = LightweightTcValForUsingInBuildMethodCall g let spanVar, spanExpr = mkCompGenLocal mEnumExpr "span" enumExprTy let idxVar, idxExpr = mkCompGenLocal mPat "idx" g.int32_ty - let (_, elemTy) = if isReadOnlySpan then destReadOnlySpanTy g mWholeExpr enumExprTy else destSpanTy g mWholeExpr enumExprTy + let _, elemTy = if isReadOnlySpan then destReadOnlySpanTy g mWholeExpr enumExprTy else destSpanTy g mWholeExpr enumExprTy let elemAddrTy = if isReadOnlySpan then mkInByrefTy g elemTy else mkByrefTy g elemTy // Evaluate the span index lookup @@ -8601,7 +8601,7 @@ and TcApplicationThen (cenv: cenv) (overallTy: OverallTy) env tpenv mExprAndArg | _ -> synArg - let (arg, tpenv) = + let arg, tpenv = // treat left and right of '||' and '&&' as control flow, so for example // f expr1 && g expr2 // will have debug points on "f expr1" and "g expr2" @@ -8847,7 +8847,7 @@ and TcUnionCaseOrExnCaseOrActivePatternResultItemThen (cenv: cenv) overallTy env | _ -> false if isSpecialCaseForBackwardCompatibility then - assert (isNull(box fittedArgs[currentIndex])) + assert isNull(box fittedArgs[currentIndex]) fittedArgs[currentIndex] <- List.item currentIndex args // grab original argument, not item from the list of named parameters currentIndex <- currentIndex + 1 else @@ -9819,7 +9819,7 @@ and GetNewInferenceTypeForMethodArg (cenv: cenv) x = // Look at all branches, keeping the one // that gives us the most syntactic information. (loopClause a, clauses) - ||> List.fold (fun ((maxClauseDepth, _) as acc) (SynMatchClause (resultExpr = a)) -> + ||> List.fold (fun (maxClauseDepth, _ as acc) (SynMatchClause (resultExpr = a)) -> match loopClause a with | clauseDepth, ty when clauseDepth > maxClauseDepth -> clauseDepth, ty | _ -> acc) @@ -10698,7 +10698,7 @@ and TcMatchPattern (cenv: cenv) inputTy env tpenv (synPat: SynPat) (synWhenExprO | TcTrueMatchClause.Yes -> WarnOnUpperUnionCaseLabel | TcTrueMatchClause.No -> WarnOnUpperVariablePatterns - let patf', (TcPatLinearEnv (tpenv, names, _)) = cenv.TcPat warnOnUpperFlag cenv env None (TcPatValFlags (ValInline.Optional, permitInferTypars, noArgOrRetAttribs, false, None, false)) (TcPatLinearEnv (tpenv, Map.empty, Set.empty)) inputTy synPat + let patf', TcPatLinearEnv (tpenv, names, _) = cenv.TcPat warnOnUpperFlag cenv env None (TcPatValFlags (ValInline.Optional, permitInferTypars, noArgOrRetAttribs, false, None, false)) (TcPatLinearEnv (tpenv, Map.empty, Set.empty)) inputTy synPat let envinner, values, vspecMap = MakeAndPublishSimpleValsForMergedScope cenv env m names let whenExprOpt, tpenv = @@ -11097,7 +11097,7 @@ and TcNormalizedBinding declKind (cenv: cenv) env tpenv overallTy safeThisValOpt let prelimValReprInfo = TranslateSynValInfo cenv mBinding (TcAttributes cenv env) valSynInfo // Check the pattern of the l.h.s. of the binding - let tcPatPhase2, (TcPatLinearEnv (tpenv, nameToPrelimValSchemeMap, _)) = + let tcPatPhase2, TcPatLinearEnv (tpenv, nameToPrelimValSchemeMap, _) = cenv.TcPat AllIdsOK cenv envinner (Some prelimValReprInfo) (TcPatValFlags (inlineFlag, explicitTyparInfo, argAndRetAttribs, isMutable, vis, isCompGen)) (TcPatLinearEnv (tpenv, NameMap.empty, Set.empty)) overallPatTy pat // Add active pattern result names to the environment @@ -12300,7 +12300,7 @@ and AnalyzeAndMakeAndPublishRecursiveValue let extraBindings, extraValues, tpenv, recBindIdx = let extraBindings = [ for extraBinding in EventDeclarationNormalization.GenerateExtraBindings cenv (bindingAttribs, binding) do - yield (NormalizedRecBindingDefn(containerInfo, newslotsOK, declKind, extraBinding)) ] + yield NormalizedRecBindingDefn(containerInfo, newslotsOK, declKind, extraBinding) ] let res, (tpenv, recBindIdx) = List.mapFold (AnalyzeAndMakeAndPublishRecursiveValue overridesOK true cenv env) (tpenv, recBindIdx) extraBindings let extraBindings, extraValues = List.unzip res List.concat extraBindings, List.concat extraValues, tpenv, recBindIdx @@ -12900,13 +12900,13 @@ let TcAndPublishValSpec (cenv: cenv, env, containerInfo: ContainerInfo, declKind let denv = env.DisplayEnv let viss = match memFlagsOpt with - | Some ({MemberKind = SynMemberKind.PropertyGetSet as propKind}) -> + | Some {MemberKind = SynMemberKind.PropertyGetSet as propKind} -> let getterAccess, setterAccess = getGetterSetterAccess vis propKind g.langVersion List.init valinfos.Length (fun i -> if i = 0 then getterAccess else setterAccess) - | Some ({MemberKind = SynMemberKind.PropertyGet as propKind}) -> + | Some {MemberKind = SynMemberKind.PropertyGet as propKind} -> let getterAccess, _ = getGetterSetterAccess vis propKind g.langVersion List.init valinfos.Length (fun _ -> getterAccess) - | Some ({MemberKind = SynMemberKind.PropertySet as propKind}) -> + | Some {MemberKind = SynMemberKind.PropertySet as propKind} -> let _, setterAccess = getGetterSetterAccess vis propKind g.langVersion List.init valinfos.Length (fun _ -> setterAccess) | _ -> diff --git a/src/Compiler/Checking/InfoReader.fs b/src/Compiler/Checking/InfoReader.fs index 861152703b1..def6ae79f75 100644 --- a/src/Compiler/Checking/InfoReader.fs +++ b/src/Compiler/Checking/InfoReader.fs @@ -463,7 +463,7 @@ type InfoReader(g: TcGlobals, amap: ImportMap) as this = let einfos = ComputeImmediateIntrinsicEventsOfType (optFilter, ad) m ty let rfinfos = GetImmediateIntrinsicRecdOrClassFieldsOfType (optFilter, ad) m ty match acc with - | _ when not (isNil qinfos) -> Some(TraitItem (qinfos)) + | _ when not (isNil qinfos) -> Some(TraitItem qinfos) | Some(MethodItem(inheritedMethSets)) when not (isNil minfos) -> Some(MethodItem (minfos :: inheritedMethSets)) | _ when not (isNil minfos) -> Some(MethodItem [minfos]) | Some(PropertyItem(inheritedPropSets)) when not (isNil pinfos) -> Some(PropertyItem(pinfos :: inheritedPropSets)) @@ -796,7 +796,7 @@ type InfoReader(g: TcGlobals, amap: ImportMap) as this = let hashFlags3 = { new IEqualityComparer with member _.GetHashCode((ad: AccessorDomain)) = AccessorDomain.CustomGetHashCode ad - member _.Equals((ad1), (ad2)) = nullSafeEquality ad1 ad2 (fun ad1 ad2 -> AccessorDomain.CustomEquals(g, ad1, ad2)) } + member _.Equals(ad1, ad2) = nullSafeEquality ad1 ad2 (fun ad1 ad2 -> AccessorDomain.CustomEquals(g, ad1, ad2)) } let hashFlags4 = { new IEqualityComparer with diff --git a/src/Compiler/Checking/MethodCalls.fs b/src/Compiler/Checking/MethodCalls.fs index 85c65fafeae..0a7f7f353bb 100644 --- a/src/Compiler/Checking/MethodCalls.fs +++ b/src/Compiler/Checking/MethodCalls.fs @@ -942,7 +942,7 @@ let ComputeConstrainedCallInfo g amap m staticTyOpt args (minfo: MethInfo) = match args, staticTyOpt with | _, Some staticTy when not minfo.IsExtensionMember && not minfo.IsInstance && (minfo.IsAbstract || minfo.IsVirtual) -> Some staticTy - | (objArgExpr :: _), _ when minfo.IsInstance && not minfo.IsExtensionMember -> + | objArgExpr :: _, _ when minfo.IsInstance && not minfo.IsExtensionMember -> let methObjTy = minfo.ApparentEnclosingType let objArgTy = tyOfExpr g objArgExpr let objArgTy = if isByrefTy g objArgTy then destByrefTy g objArgTy else objArgTy @@ -1299,7 +1299,7 @@ let MethInfoChecks g amap isInstance tyargsOpt objArgs ad m (minfo: MethInfo) = /// Build a call to the System.Object constructor taking no arguments, let BuildObjCtorCall (g: TcGlobals) m = - let ilMethRef = (mkILCtorMethSpecForTy(g.ilg.typ_Object, [])).MethodRef + let ilMethRef = mkILCtorMethSpecForTy(g.ilg.typ_Object, []).MethodRef Expr.Op (TOp.ILCall (false, false, false, false, CtorValUsedAsSuperInit, false, true, ilMethRef, [], [], [g.obj_ty_noNulls]), [], [], m) /// Implements the elaborated form of adhoc conversions from functions to delegates at member callsites @@ -1963,7 +1963,7 @@ module ProvidedMethodCalls = let exprR = mkValSet m (mkLocalValRef vR) eR None, (exprR, tyOfExpr g exprR) | ProvidedWhileLoopExpr (guardExpr, bodyExpr) -> - let guardExpr, bodyExpr = (exprType.PApply2((fun _ -> (guardExpr, bodyExpr)), m)) + let guardExpr, bodyExpr = exprType.PApply2((fun _ -> (guardExpr, bodyExpr)), m) let guardExprR = exprToExpr guardExpr let bodyExprR = exprToExpr bodyExpr let exprR = mkWhile g (DebugPointAtWhile.No, SpecialWhileLoopMarker.NoSpecialWhileLoopMarker, guardExprR, bodyExprR, m) diff --git a/src/Compiler/Checking/MethodOverrides.fs b/src/Compiler/Checking/MethodOverrides.fs index 386390187bd..60da9ac1ba4 100644 --- a/src/Compiler/Checking/MethodOverrides.fs +++ b/src/Compiler/Checking/MethodOverrides.fs @@ -267,7 +267,7 @@ module DispatchSlotChecking = // Compare the types. CompiledSigOfMeth, GetObjectExprOverrideInfo and GetTypeMemberOverrideInfo have already // applied all relevant substitutions except the renamings from fvtmps <-> methTypars - let aenv = (TypeEquivEnv.EmptyIgnoreNulls).FromEquivTypars fvmethTypars methTypars + let aenv = TypeEquivEnv.EmptyIgnoreNulls.FromEquivTypars fvmethTypars methTypars List.forall2 (List.lengthsEqAndForall2 (typeAEquiv g aenv)) vargTys argTys && returnTypesAEquiv g aenv vrty retTy && @@ -303,7 +303,7 @@ module DispatchSlotChecking = ComposeTyparInsts ttpinst (ReverseTyparRenaming g memberToParentInst) // Compare under the composed substitutions - let aenv = (TypeEquivEnv.EmptyIgnoreNulls).FromTyparInst ttpinst + let aenv = TypeEquivEnv.EmptyIgnoreNulls.FromTyparInst ttpinst typarsAEquiv g aenv fvmethTypars methTypars @@ -638,7 +638,8 @@ module DispatchSlotChecking = // dispatch slots are ordered from the derived classes to base // so we can check the topmost dispatch slot if it is final match dispatchSlots with - | meth :: _ when meth.IsFinal -> errorR(Error(FSComp.SR.tcCannotOverrideSealedMethod((sprintf "%s::%s" (NicePrint.stringOfTy denv meth.ApparentEnclosingType) meth.LogicalName)), m)) + | meth :: _ when meth.IsFinal -> errorR(Error(FSComp.SR.tcCannotOverrideSealedMethod + (sprintf "%s::%s" (NicePrint.stringOfTy denv meth.ApparentEnclosingType) meth.LogicalName), m)) | _ -> () /// Get the slots of a type that can or must be implemented. This depends diff --git a/src/Compiler/Checking/NameResolution.fs b/src/Compiler/Checking/NameResolution.fs index 181911ec2bd..2077a103b95 100644 --- a/src/Compiler/Checking/NameResolution.fs +++ b/src/Compiler/Checking/NameResolution.fs @@ -2108,15 +2108,15 @@ type TcResultsSinkImpl(tcGlobals, ?sourceText: ISourceText) = let capturedNameResolutionIdentifiers = HashSet - ( { new IEqualityComparer<_> with - member _.GetHashCode((p: pos, i)) = p.Line + 101 * p.Column + hash i - member _.Equals((p1, i1), (p2, i2)) = posEq p1 p2 && i1 = i2 } ) + { new IEqualityComparer<_> with + member _.GetHashCode((p: pos, i)) = p.Line + 101 * p.Column + hash i + member _.Equals((p1, i1), (p2, i2)) = posEq p1 p2 && i1 = i2 } let capturedModulesAndNamespaces = HashSet - ( { new IEqualityComparer with - member _.GetHashCode ((m, _)) = hash m - member _.Equals ((m1, item1), (m2, item2)) = equals m1 m2 && ItemsAreEffectivelyEqual tcGlobals item1 item2 } ) + { new IEqualityComparer with + member _.GetHashCode ((m, _)) = hash m + member _.Equals ((m1, item1), (m2, item2)) = equals m1 m2 && ItemsAreEffectivelyEqual tcGlobals item1 item2 } let allowedRange (m: range) = not m.IsSynthetic @@ -3255,16 +3255,16 @@ let rec ResolveExprLongIdentPrim sink (ncenv: NameResolver) first fullyQualified let innerSearch = search +++ (moduleSearch AccessibleFromSomeFSharpCode) +++ (tyconSearch AccessibleFromSomeFSharpCode) let suggestEverythingInScope (addToBuffer: string -> unit) = - for (KeyValue(_,modrefs)) in nenv.ModulesAndNamespaces fullyQualified do + for KeyValue(_,modrefs) in nenv.ModulesAndNamespaces fullyQualified do for modref in modrefs do if IsEntityAccessible ncenv.amap m ad modref then addToBuffer modref.DisplayName - for (KeyValue(_,tcref)) in nenv.TyconsByDemangledNameAndArity fullyQualified do + for KeyValue(_,tcref) in nenv.TyconsByDemangledNameAndArity fullyQualified do if IsEntityAccessible ncenv.amap m ad tcref then addToBuffer tcref.DisplayName - for (KeyValue(_,item)) in nenv.eUnqualifiedItems do + for KeyValue(_,item) in nenv.eUnqualifiedItems do if canSuggestThisItem item then addToBuffer item.DisplayName @@ -4525,7 +4525,7 @@ let ResolveCompletionsInType (ncenv: NameResolver) nenv (completionTargets: Reso if methsWithStaticParams.IsEmpty then minfos else minfos |> List.filter (fun minfo -> let nm = minfo.LogicalName - not (nm.Contains "," && methsWithStaticParams |> List.exists (nm.StartsWithOrdinal))) + not (nm.Contains "," && methsWithStaticParams |> List.exists nm.StartsWithOrdinal)) #endif minfos @@ -5217,7 +5217,7 @@ let ResolveCompletionsInTypeForItem (ncenv: NameResolver) nenv m ad statics ty ( if methsWithStaticParams.IsEmpty then minfos else minfos |> List.filter (fun minfo -> let nm = minfo.LogicalName - not (nm.Contains "," && methsWithStaticParams |> List.exists (nm.StartsWithOrdinal))) + not (nm.Contains "," && methsWithStaticParams |> List.exists nm.StartsWithOrdinal)) #endif minfos diff --git a/src/Compiler/Checking/NicePrint.fs b/src/Compiler/Checking/NicePrint.fs index 94a239da048..ce880a4c608 100644 --- a/src/Compiler/Checking/NicePrint.fs +++ b/src/Compiler/Checking/NicePrint.fs @@ -1697,15 +1697,15 @@ module InfoMemberPrinting = let methodLayout = // Render Method attributes and [return:..] attributes on separate lines above (@@) the method definition PrintTypes.layoutCsharpCodeAnalysisIlAttributes denv (minfo.GetCustomAttrs()) (squareAngleL >> (@@)) layout - |> PrintTypes.layoutCsharpCodeAnalysisIlAttributes denv (mi.RawMetadata.Return.CustomAttrs) (squareAngleReturn >> (@@)) + |> PrintTypes.layoutCsharpCodeAnalysisIlAttributes denv mi.RawMetadata.Return.CustomAttrs (squareAngleReturn >> (@@)) let paramLayouts = minfo.GetParamDatas (amap, m, minst) |> List.head - |> List.zip (mi.ParamMetadata) + |> List.zip mi.ParamMetadata |> List.map(fun (ilParams,paramData) -> layoutParamData denv paramData // Render parameter attributes next to (^^) the parameter definition - |> PrintTypes.layoutCsharpCodeAnalysisIlAttributes denv (ilParams.CustomAttrs) (squareAngleL >> (^^)) ) + |> PrintTypes.layoutCsharpCodeAnalysisIlAttributes denv ilParams.CustomAttrs (squareAngleL >> (^^)) ) methodLayout,paramLayouts | _ -> layout, diff --git a/src/Compiler/Checking/PatternMatchCompilation.fs b/src/Compiler/Checking/PatternMatchCompilation.fs index 15bb5373205..0532182fb88 100644 --- a/src/Compiler/Checking/PatternMatchCompilation.fs +++ b/src/Compiler/Checking/PatternMatchCompilation.fs @@ -688,9 +688,9 @@ let canCompactConstantClass c = let discrimWithinSimultaneousClass g amap m discrim prev = match discrim, prev with | _, [] -> true - | DecisionTreeTest.Const _, (DecisionTreeTest.Const _ :: _) - | DecisionTreeTest.ArrayLength _, (DecisionTreeTest.ArrayLength _ :: _) - | DecisionTreeTest.UnionCase _, (DecisionTreeTest.UnionCase _ :: _) -> true + | DecisionTreeTest.Const _, DecisionTreeTest.Const _ :: _ + | DecisionTreeTest.ArrayLength _, DecisionTreeTest.ArrayLength _ :: _ + | DecisionTreeTest.UnionCase _, DecisionTreeTest.UnionCase _ :: _ -> true | DecisionTreeTest.IsNull, _ -> // Check that each previous test in the set, if successful, gives some information about this test @@ -708,7 +708,8 @@ let discrimWithinSimultaneousClass g amap m discrim prev = | DecisionTreeTest.IsInst (_, tgtTy1) -> computeWhatSuccessfulTypeTestImpliesAboutTypeTest g amap m tgtTy1 tgtTy2 <> Implication.Nothing | _ -> false) - | DecisionTreeTest.ActivePatternCase (_, _, _, apatVrefOpt1, _, _), (DecisionTreeTest.ActivePatternCase (_, _, _, apatVrefOpt2, _, _) :: _) -> + | DecisionTreeTest.ActivePatternCase (_, _, _, apatVrefOpt1, _, _), + DecisionTreeTest.ActivePatternCase (_, _, _, apatVrefOpt2, _, _) :: _ -> match apatVrefOpt1, apatVrefOpt2 with | Some (vref1, tinst1), Some (vref2, tinst2) -> valRefEq g vref1 vref2 && not (doesActivePatternHaveFreeTypars g vref1) && List.lengthsEqAndForall2 (typeEquiv g) tinst1 tinst2 | _ -> false (* for equality purposes these are considered different classes of discriminators! This is because adhoc computed patterns have no identity! *) @@ -1362,7 +1363,7 @@ let CompilePatternBasic let fallthroughPathFrontiers = List.filter (isRefuted >> not) fallthroughPathFrontiers (* Add to the refuted set *) - let refuted = (RefutedInvestigation(path, simulSetOfDiscrims)) :: refuted + let refuted = RefutedInvestigation(path, simulSetOfDiscrims) :: refuted match fallthroughPathFrontiers with | [] -> @@ -1376,7 +1377,7 @@ let CompilePatternBasic let (Frontier (i, actives, valMap)) = frontier if isMemOfActives path actives then - let (subExprForActive, patAtActive) = lookupActive path actives + let subExprForActive, patAtActive = lookupActive path actives let (SubExpr(accessf, ve)) = subExprForActive let mkSubFrontiers path subAccess subActive argpats pathBuilder = @@ -1562,7 +1563,7 @@ let CompilePatternBasic else [frontier] - and BindProjectionPattern inpActive ((accActive, accValMap) as activeState) = + and BindProjectionPattern inpActive (accActive, accValMap as activeState) = let (Active(inpPath, inpExpr, pat)) = inpActive let (SubExpr(inpAccess, inpExprAndVal)) = inpExpr diff --git a/src/Compiler/Checking/PostInferenceChecks.fs b/src/Compiler/Checking/PostInferenceChecks.fs index 906c0fc82db..b9a3b4df351 100644 --- a/src/Compiler/Checking/PostInferenceChecks.fs +++ b/src/Compiler/Checking/PostInferenceChecks.fs @@ -530,7 +530,7 @@ let CheckTypeForAccess (cenv: cenv) env objName valAcc m ty = let thisCompPath = compPathOfCcu cenv.viewCcu let tyconAcc = tcref.Accessibility |> AccessInternalsVisibleToAsInternal thisCompPath cenv.internalsVisibleToPaths if isLessAccessible tyconAcc valAcc then - errorR(Error(FSComp.SR.chkTypeLessAccessibleThanType(tcref.DisplayName, (objName())), m)) + errorR(Error(FSComp.SR.chkTypeLessAccessibleThanType(tcref.DisplayName, objName()), m)) CheckTypeDeep cenv (visitType, None, None, None, None) cenv.g env NoInfo ty @@ -546,7 +546,7 @@ let WarnOnWrongTypeForAccess (cenv: cenv) env objName valAcc m ty = let thisCompPath = compPathOfCcu cenv.viewCcu let tyconAcc = tcref.Accessibility |> AccessInternalsVisibleToAsInternal thisCompPath cenv.internalsVisibleToPaths if isLessAccessible tyconAcc valAcc then - let errorText = FSComp.SR.chkTypeLessAccessibleThanType(tcref.DisplayName, (objName())) |> snd + let errorText = FSComp.SR.chkTypeLessAccessibleThanType(tcref.DisplayName, objName()) |> snd let warningText = errorText + Environment.NewLine + FSComp.SR.tcTypeAbbreviationsCheckedAtCompileTime() warning(ObsoleteDiagnostic(false, None, Some warningText, None, m)) @@ -865,7 +865,7 @@ and CheckValUse (cenv: cenv) (env: env) (vref: ValRef, vFlags, m) (ctxt: PermitB let isReturnOfStructThis = ctxt.PermitOnlyReturnable && isByrefTy g vref.Type && - (vref.IsMemberThisVal) + vref.IsMemberThisVal if isReturnOfStructThis then errorR(Error(FSComp.SR.chkStructsMayNotReturnAddressesOfContents(), m)) @@ -1907,7 +1907,7 @@ and CheckDecisionTree cenv env dtree = and CheckDecisionTreeSwitch cenv env (inpExpr, cases, dflt, m) = CheckExprPermitByRefLike cenv env inpExpr |> ignore// can be byref for struct union switch - for (TCase(discrim, dtree)) in cases do + for TCase(discrim, dtree) in cases do CheckDecisionTreeTest cenv env m discrim CheckDecisionTree cenv env dtree dflt |> Option.iter (CheckDecisionTree cenv env) @@ -2472,7 +2472,7 @@ let CheckEntityDefn cenv env (tycon: Entity) = setterArgs.Length <> getterArgs.Length) || (let nargs = pinfo.GetParamTypes(cenv.amap, m).Length - others |> List.exists (fun pinfo2 -> (isNil(pinfo2.GetParamTypes(cenv.amap, m))) <> (nargs = 0)))) then + others |> List.exists (fun pinfo2 -> isNil(pinfo2.GetParamTypes(cenv.amap, m)) <> (nargs = 0)))) then errorR(Error(FSComp.SR.chkPropertySameNameIndexer(nm, NicePrint.minimalStringOfType cenv.denv ty), m)) diff --git a/src/Compiler/Checking/SignatureConformance.fs b/src/Compiler/Checking/SignatureConformance.fs index d922423017f..00df5d719b8 100644 --- a/src/Compiler/Checking/SignatureConformance.fs +++ b/src/Compiler/Checking/SignatureConformance.fs @@ -172,7 +172,7 @@ type Checker(g, amap, denv, remapInfo: SignatureRepackageInfo, checkingSig) = (errorR(Error(FSComp.SR.typrelSigImplNotCompatibleConstraintsDifferRemove(sigTypar.Name, LayoutRender.showL(NicePrint.layoutTyparConstraint denv (sigTypar, sigTyparCx))), m)); false) else true) && - (not checkingSig || checkAttribs aenv implTypar.Attribs sigTypar.Attribs (implTypar.SetAttribs))) + (not checkingSig || checkAttribs aenv implTypar.Attribs sigTypar.Attribs implTypar.SetAttribs)) and checkTypeDef (aenv: TypeEquivEnv) (infoReader: InfoReader) (implTycon: Tycon) (sigTycon: Tycon) = let m = implTycon.Range diff --git a/src/Compiler/Checking/SignatureHash.fs b/src/Compiler/Checking/SignatureHash.fs index 8102f8dd364..f81ada24082 100644 --- a/src/Compiler/Checking/SignatureHash.fs +++ b/src/Compiler/Checking/SignatureHash.fs @@ -165,7 +165,7 @@ let calculateHashOfImpliedSignature g observer (expr: ModuleOrNamespaceContents) and hashSingleModuleOrNamespaceContents x = match x with | TMDefRec(_, _opens, tycons, mbinds, _) -> - let mbindsHash = mbinds |> hashListOrderIndependent (hashModuleOrNameSpaceBinding) + let mbindsHash = mbinds |> hashListOrderIndependent hashModuleOrNameSpaceBinding let tyconsHash = TyconDefinitionHash.hashTyconDefns (g, observer) tycons diff --git a/src/Compiler/Checking/TypeHierarchy.fs b/src/Compiler/Checking/TypeHierarchy.fs index c37321f4b4a..266e44214b2 100644 --- a/src/Compiler/Checking/TypeHierarchy.fs +++ b/src/Compiler/Checking/TypeHierarchy.fs @@ -445,8 +445,8 @@ let FixupNewTypars m (formalEnclosingTypars: Typars) (tinst: TType list) (tpsori let n1 = tinst.Length let n2 = tpsorig.Length let n3 = tps.Length - if n0 <> n1 then error(Error((FSComp.SR.tcInvalidTypeArgumentCount(n0, n1)), m)) - if n2 <> n3 then error(Error((FSComp.SR.tcInvalidTypeArgumentCount(n2, n3)), m)) + if n0 <> n1 then error(Error(FSComp.SR.tcInvalidTypeArgumentCount(n0, n1), m)) + if n2 <> n3 then error(Error(FSComp.SR.tcInvalidTypeArgumentCount(n2, n3), m)) // The real code.. let renaming, tptys = mkTyparToTyparRenaming tpsorig tps diff --git a/src/Compiler/Checking/import.fs b/src/Compiler/Checking/import.fs index d7ca0e514cc..3b0faa7ebe2 100644 --- a/src/Compiler/Checking/import.fs +++ b/src/Compiler/Checking/import.fs @@ -330,13 +330,13 @@ let rec ImportILTypeWithNullness (env: ImportMap) m tinst (nf:Nullness.NullableF | ILType.Array(bounds, innerTy) -> let n = bounds.Rank - let (arrayNullness,nf) = Nullness.evaluateFirstOrderNullnessAndAdvance ty nf + let arrayNullness,nf = Nullness.evaluateFirstOrderNullnessAndAdvance ty nf let struct(elemTy,nf) = ImportILTypeWithNullness env m tinst nf innerTy mkArrayTy env.g n arrayNullness elemTy m, nf | ILType.Boxed tspec | ILType.Value tspec -> let tcref = ImportILTypeRef env m tspec.TypeRef - let (typeRefNullness,nf) = Nullness.evaluateFirstOrderNullnessAndAdvance ty nf + let typeRefNullness,nf = Nullness.evaluateFirstOrderNullnessAndAdvance ty nf let struct(inst,nullableFlagsLeft) = (nf,tspec.GenericArgs) ||> List.vMapFold (fun nf current -> ImportILTypeWithNullness env m tinst nf current ) ImportTyconRefApp env tcref inst typeRefNullness, nullableFlagsLeft @@ -364,7 +364,7 @@ let rec ImportILTypeWithNullness (env: ImportMap) m tinst (nf:Nullness.NullableF with _ -> error(Error(FSComp.SR.impNotEnoughTypeParamsInScopeWhileImporting(), m)) - let (typeVarNullness,nf) = Nullness.evaluateFirstOrderNullnessAndAdvance ty nf + let typeVarNullness,nf = Nullness.evaluateFirstOrderNullnessAndAdvance ty nf addNullnessToTy typeVarNullness ttype, nf /// Determines if an IL type can be imported as an F# type diff --git a/src/Compiler/Checking/infos.fs b/src/Compiler/Checking/infos.fs index 79a73ee39fa..58f973e928a 100644 --- a/src/Compiler/Checking/infos.fs +++ b/src/Compiler/Checking/infos.fs @@ -1323,7 +1323,7 @@ type MethInfo = match x with | FSMeth(g, _, vref, _) -> match vref.RecursiveValInfo with - | ValInRecScope false -> error(Error((FSComp.SR.InvalidRecursiveReferenceToAbstractSlot()), m)) + | ValInRecScope false -> error(Error(FSComp.SR.InvalidRecursiveReferenceToAbstractSlot(), m)) | _ -> () let allTyparsFromMethod, _, _, retTy, _ = GetTypeOfMemberInMemberForm g vref @@ -2269,7 +2269,7 @@ let private tyConformsToIDelegateEvent g ty = /// Create an error object to raise should an event not have the shape expected by the .NET idiom described further below let nonStandardEventError nm m = - Error ((FSComp.SR.eventHasNonStandardType(nm, ("add_"+nm), ("remove_"+nm))), m) + Error (FSComp.SR.eventHasNonStandardType(nm, ("add_"+nm), ("remove_"+nm)), m) /// Find the delegate type that an F# event property implements by looking through the type hierarchy of the type of the property /// for the first instantiation of IDelegateEvent. diff --git a/src/Compiler/CodeGen/EraseClosures.fs b/src/Compiler/CodeGen/EraseClosures.fs index e1c533f17b2..6585fa1d661 100644 --- a/src/Compiler/CodeGen/EraseClosures.fs +++ b/src/Compiler/CodeGen/EraseClosures.fs @@ -552,7 +552,7 @@ let rec convIlxClosureDef cenv encl (td: ILTypeDef) clo = ILMemberAccess.Public, addedGenParams (* method is generic over added ILGenericParameterDefs *) , [], - mkILReturn (cenv.ilg.typ_Object), + mkILReturn cenv.ilg.typ_Object, MethodBody.IL(notlazy convil) ) @@ -628,7 +628,7 @@ let rec convIlxClosureDef cenv encl (td: ILTypeDef) clo = for nowField in nowFields do yield! mkLdFreeVar nowCloSpec nowField // Load up all the arguments (including self), which become free variables in the delegated closure - for (n, _) in argToFreeVarMap do + for n, _ in argToFreeVarMap do mkLdarg (uint16 n) // Make the instance of the delegated closure && return it. I_newobj(laterCloSpec.Constructor, None) diff --git a/src/Compiler/CodeGen/EraseUnions.fs b/src/Compiler/CodeGen/EraseUnions.fs index 43dfc00ee2e..3e24a332d33 100644 --- a/src/Compiler/CodeGen/EraseUnions.fs +++ b/src/Compiler/CodeGen/EraseUnions.fs @@ -378,7 +378,7 @@ let convNewDataInstrInternal ilg cuspec cidx = && cuspecRepr.DiscriminationTechnique cuspec = IntegerTag then // Structs with fields should be created using maker methods (mkMakerName), only field-less cases are created this way - assert (alt.IsNullary) + assert alt.IsNullary let baseTy = baseTyOfUnionSpec cuspec let tagField = [ mkTagFieldType ilg cuspec ] [ mkLdcInt32 cidx; mkNormalNewobj (mkILCtorMethSpecForTy (baseTy, tagField)) ] @@ -852,7 +852,7 @@ let convAlternativeDef methName, cud.UnionCasesAccessibility, [], - mkILReturn (baseTy), + mkILReturn baseTy, mkMethodBody ( true, [], @@ -1015,7 +1015,7 @@ let convAlternativeDef (baseMakerMeths @ baseTesterMeths), (baseMakerProps @ baseTesterProps) - | NoHelpers when not (alt.IsNullary) && cuspecRepr.RepresentAlternativeAsStructValue(cuspec) -> + | NoHelpers when not alt.IsNullary && cuspecRepr.RepresentAlternativeAsStructValue(cuspec) -> // For non-nullary struct DUs, maker method is used to create their values. [ makeNonNullaryMakerMethod () ], [] | NoHelpers -> [], [] @@ -1403,7 +1403,7 @@ let mkClassUnionDef mkILCustomAttribMethRef (method, [ ILAttribElem.Byte 2uy ], []) | Encoded(method, _data, - [ ILAttribElem.Array(elemType, (ILAttribElem.Byte 1uy) :: otherElems) ]) -> + [ ILAttribElem.Array(elemType, ILAttribElem.Byte 1uy :: otherElems) ]) -> mkILCustomAttribMethRef ( method, [ ILAttribElem.Array(elemType, (ILAttribElem.Byte 2uy) :: otherElems) ], diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index 77955988ebe..553e6ac9aa1 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -519,7 +519,7 @@ let ComputeTypeAccess (tref: ILTypeRef) hidden (accessibility: Accessibility) re /// Indicates how type parameters are mapped to IL type variables [] type TypeReprEnv - (reprs: Map, count: int, templateReplacement: (TyconRef * ILTypeRef * Typars * TyparInstantiation) option) = + (reprs: Map, count: int, templateReplacement: (TyconRef * ILTypeRef * Typars * TyparInstantiation) option) = static let empty = TypeReprEnv(count = 0, reprs = Map.empty, templateReplacement = None) @@ -855,7 +855,7 @@ and GenTypeArgs cenv m tyenv tyargs = GenTypeArgsAux cenv m tyenv tyargs // Computes the location where the static field for a value lives. // - Literals go in their type/module. // - For interactive code, we always place fields in their type/module with an accurate name -let GenFieldSpecForStaticField (isInteractive, (g: TcGlobals), ilContainerTy, vspec: Val, nm, m, cloc, ilTy) = +let GenFieldSpecForStaticField (isInteractive, g: TcGlobals, ilContainerTy, vspec: Val, nm, m, cloc, ilTy) = let fieldName = vspec.CompiledName g.CompilerGlobalState @@ -2453,7 +2453,7 @@ and AssemblyBuilder(cenv: cenv, anonTypeTable: AnonTypeGenerationTable) as mgbuf // old implementation adds new element to the head of list so result was accumulated in reversed order let orderedReflectedDefinitions = [ - for (vspec, (n, (name, expr))) in reflectedDefinitions.GetAll() -> n, ((name, vspec), expr) + for vspec, (n, (name, expr)) in reflectedDefinitions.GetAll() -> n, ((name, vspec), expr) ] |> List.sortBy (fst >> (~-)) // invert the result to get 'order-by-descending' behavior (items in list are 0..* so we don't need to worry about int.MinValue) |> List.map snd @@ -2935,7 +2935,7 @@ and GenExprPreSteps (cenv: cenv) (cgbuf: CodeGenBuffer) eenv expr sequel = // Check for the '__debugPoint" construct for inlined code match expr with - | Expr.Sequential((DebugPointExpr g debugPointName) as dpExpr, codeExpr, NormalSeq, m) -> + | Expr.Sequential(DebugPointExpr g debugPointName as dpExpr, codeExpr, NormalSeq, m) -> match cenv.namedDebugPointsForInlinedCode.TryGetValue({ Range = m; Name = debugPointName }) with | false, _ when String.IsNullOrEmpty(debugPointName) -> CG.EmitDebugPoint cgbuf m | false, _ -> @@ -3000,13 +3000,13 @@ and GenExprPreSteps (cenv: cenv) (cgbuf: CodeGenBuffer) eenv expr sequel = // is important if the nested state machine generates dynamic code (LoweredStateMachineResult.UseAlternative). let eenv = RemoveTemplateReplacement eenv checkLanguageFeatureError cenv.g.langVersion LanguageFeature.ResumableStateMachines expr.Range - warning (Error(FSComp.SR.reprStateMachineNotCompilable (msg), expr.Range)) + warning (Error(FSComp.SR.reprStateMachineNotCompilable msg, expr.Range)) GenExpr cenv cgbuf eenv altExpr sequel true | LoweredStateMachineResult.NoAlternative msg -> let eenv = RemoveTemplateReplacement eenv checkLanguageFeatureError cenv.g.langVersion LanguageFeature.ResumableStateMachines expr.Range - errorR (Error(FSComp.SR.reprStateMachineNotCompilableNoAlternative (msg), expr.Range)) + errorR (Error(FSComp.SR.reprStateMachineNotCompilableNoAlternative msg, expr.Range)) GenDefaultValue cenv cgbuf eenv (tyOfExpr cenv.g expr, expr.Range) true | LoweredStateMachineResult.NotAStateMachine -> @@ -3177,7 +3177,7 @@ and CodeGenMethodForExpr cenv mgbuf (entryPointInfo, methodName, eenv, alreadyUs code -and DelayCodeGenMethodForExpr cenv mgbuf ((_, _, eenv, _, _, _, _) as args) = +and DelayCodeGenMethodForExpr cenv mgbuf (_, _, eenv, _, _, _, _ as args) = let change3rdOutOf7 (a1, a2, _, a4, a5, a6, a7) newA3 = (a1, a2, newA3, a4, a5, a6, a7) if eenv.delayCodeGen then @@ -3658,13 +3658,13 @@ and GenNewArraySimple cenv cgbuf eenv (elems, elemTy, m) sequel = (pop 0) (Push [ ilArrTy ]) [ - (AI_ldc(DT_I4, ILConst.I4 elems.Length)) + AI_ldc(DT_I4, ILConst.I4 elems.Length) I_newarr(ILArrayShape.SingleDimensional, ilElemTy) ] elems |> List.iteri (fun i e -> - CG.EmitInstrs cgbuf (pop 0) (Push [ ilArrTy; cenv.g.ilg.typ_Int32 ]) [ AI_dup; (AI_ldc(DT_I4, ILConst.I4 i)) ] + CG.EmitInstrs cgbuf (pop 0) (Push [ ilArrTy; cenv.g.ilg.typ_Int32 ]) [ AI_dup; AI_ldc(DT_I4, ILConst.I4 i) ] GenExpr cenv cgbuf eenv e Continue CG.EmitInstr cgbuf (pop 3) Push0 (I_stelem_any(ILArrayShape.SingleDimensional, ilElemTy))) @@ -4232,7 +4232,7 @@ and GenApp (cenv: cenv) cgbuf eenv (f, fty, tyargs, curriedArgs, m) sequel = || valRefEq g v g.cgh__resumableEntry_vref || valRefEq g v g.cgh__stateMachine_vref -> - errorR (Error(FSComp.SR.ilxgenInvalidConstructInStateMachineDuringCodegen (v.DisplayName), m)) + errorR (Error(FSComp.SR.ilxgenInvalidConstructInStateMachineDuringCodegen v.DisplayName, m)) CG.EmitInstr cgbuf (pop 0) (Push [ g.ilg.typ_Object ]) AI_ldnull GenSequel cenv eenv.cloc cgbuf sequel @@ -5083,7 +5083,7 @@ and GenIntegerForLoop cenv cgbuf eenv (spFor, spTo, v, e1, dir, e2, loopBody, m) | FSharpForLoopDown -> BI_bne_un | CSharpForLoopUp -> BI_blt - let e2Sequel = (CmpThenBrOrContinue(pop 2, [ I_brcmp(cmp, inner.CodeLabel) ])) + let e2Sequel = CmpThenBrOrContinue(pop 2, [ I_brcmp(cmp, inner.CodeLabel) ]) if isFSharpStyle then EmitGetLocal cgbuf g.ilg.typ_Int32 finishIdx @@ -5235,7 +5235,7 @@ and GenAsmCode cenv cgbuf eenv (il, tyargs, args, returnTys, m) sequel = Expr.Const((Const.Bool false | Const.SByte 0y | Const.Int16 0s | Const.Int32 0 | Const.Int64 0L | Const.Byte 0uy | Const.UInt16 0us | Const.UInt32 0u | Const.UInt64 0UL), _, _) ], - CmpThenBrOrContinue(1, [ I_brcmp((BI_brfalse | BI_brtrue) as bi, label1) ]), + CmpThenBrOrContinue(1, [ I_brcmp(BI_brfalse | BI_brtrue as bi, label1) ]), _) -> let bi = @@ -5525,7 +5525,7 @@ and GenTraitCall (cenv: cenv) cgbuf eenv (traitInfo: TraitConstraintInfo, argExp match exprOpt with | None -> let exnArg = - mkString g m (FSComp.SR.ilDynamicInvocationNotSupported (traitInfo.MemberLogicalName)) + mkString g m (FSComp.SR.ilDynamicInvocationNotSupported traitInfo.MemberLogicalName) let exnExpr = MakeNotSupportedExnExpr cenv eenv (exnArg, m) let replacementExpr = mkThrow m (tyOfExpr g expr) exnExpr @@ -5573,7 +5573,7 @@ and GenGetValAddr cenv cgbuf eenv (v: ValRef, m) sequel = | Method _ | Env _ | Null -> - errorR (Error(FSComp.SR.ilAddressOfValueHereIsInvalid (v.DisplayName), m)) + errorR (Error(FSComp.SR.ilAddressOfValueHereIsInvalid v.DisplayName, m)) CG.EmitInstr cgbuf @@ -5727,7 +5727,7 @@ and GenGenericParam cenv eenv (tp: Typar) = | _ -> () ] - let tpAttrs = mkILCustomAttrs (attributeList) + let tpAttrs = mkILCustomAttrs attributeList let modreqValueType () = ILType.Modified(true, g.iltyp_UnmanagedType.TypeRef, g.iltyp_ValueType) @@ -7410,7 +7410,7 @@ and GenJoinPoint cenv cgbuf pos eenv ty m sequel = // The others (e.g. Continue, LeaveFilter and CmpThenBrOrContinue) can't be done at the end of each branch. We must create a join point. | _ -> let pushed = GenType cenv m eenv.tyenv ty - let stackAfterJoin = (pushed :: (cgbuf.GetCurrentStack())) + let stackAfterJoin = (pushed :: cgbuf.GetCurrentStack()) let afterJoin = CG.GenerateDelayMark cgbuf (pos + "_join") // go to the join point Br afterJoin, afterJoin, stackAfterJoin, sequel @@ -7642,7 +7642,7 @@ and GenDecisionTreeTarget cenv cgbuf stackAtTargets targetInfo sequel = GenBindings cenv cgbuf eenvAtTarget binds stateVarFlagsOpt CG.SetMarkToHere cgbuf targetMarkAfterBinds CG.SetStack cgbuf stackAtTargets - (eenvAtTarget, successExpr, (EndLocalScope(sequel, endMark))) + (eenvAtTarget, successExpr, EndLocalScope(sequel, endMark)) and GenDecisionTreeSwitch cenv @@ -7708,7 +7708,7 @@ and GenDecisionTreeSwitch let avoidHelpers = entityRefInThisAssembly g.compilingFSharpCore c.TyconRef let tester = - (Some(pop 1, Push [ g.ilg.typ_Bool ], Choice1Of2(avoidHelpers, cuspec, idx))) + Some(pop 1, Push [ g.ilg.typ_Bool ], Choice1Of2(avoidHelpers, cuspec, idx)) GenDecisionTreeTest cenv @@ -8671,7 +8671,7 @@ and GenBindingAfterDebugPoint cenv cgbuf eenv bind isStateVar startMarkOpt = mkNormalStsfld fspec ] - CG.EmitInstrs cgbuf (pop 0) (Push0) ilInstrs + CG.EmitInstrs cgbuf (pop 0) Push0 ilInstrs [ attrib ] | _ -> failwith "unreachable" | _ -> failwith "unreachable" @@ -9741,9 +9741,9 @@ and GenSetStorage m cgbuf storage = CG.EmitInstr cgbuf (pop 1) Push0 (I_call(Normalcall, mkILMethSpecForMethRefInTy (ilSetterMethRef, ilContainerTy, []), None)) - | StaticProperty(ilGetterMethSpec, _) -> error (Error(FSComp.SR.ilStaticMethodIsNotLambda (ilGetterMethSpec.Name), m)) + | StaticProperty(ilGetterMethSpec, _) -> error (Error(FSComp.SR.ilStaticMethodIsNotLambda ilGetterMethSpec.Name, m)) - | Method(_, _, mspec, _, m, _, _, _, _, _, _, _) -> error (Error(FSComp.SR.ilStaticMethodIsNotLambda (mspec.Name), m)) + | Method(_, _, mspec, _, m, _, _, _, _, _, _, _) -> error (Error(FSComp.SR.ilStaticMethodIsNotLambda mspec.Name, m)) | Null -> CG.EmitInstr cgbuf (pop 1) Push0 AI_pop @@ -9982,7 +9982,7 @@ and AllocValReprWithinExpr cenv cgbuf endMark cloc v eenv = /// - [gross] because IL flushes the stack at the exn. handler /// - and because IL requires empty stack following a forward br (jump). and EmitSaveStack cenv cgbuf eenv m scopeMarks = - let savedStack = (cgbuf.GetCurrentStack()) + let savedStack = cgbuf.GetCurrentStack() let savedStackLocals, eenvinner = (eenv, savedStack) @@ -10259,7 +10259,7 @@ and CodeGenInitMethod cenv (cgbuf: CodeGenBuffer) eenv tref (codeGenInitFunc: Co let methodSpec = mkILNonGenericStaticMethSpecInTy (ty, eenv.staticInitializationName, [], ILType.Void) - cgbuf.EmitInstr((pop 0), Push0, mkNormalCall (methodSpec)) + cgbuf.EmitInstr((pop 0), Push0, mkNormalCall methodSpec) and GenModuleOrNamespaceContents cenv (cgbuf: CodeGenBuffer) qname lazyInitInfo eenv x = match x with @@ -10303,7 +10303,7 @@ and GenModuleOrNamespaceContents cenv (cgbuf: CodeGenBuffer) qname lazyInitInfo GenLetRecBindings cenv cgbuf eenv (recBinds, m) dict bindsRemaining <- otherBinds - | (ModuleOrNamespaceBinding.Module _ as mbind) :: rest -> + | ModuleOrNamespaceBinding.Module _ as mbind :: rest -> GenModuleBinding cenv cgbuf qname lazyInitInfo eenvinner m mbind bindsRemaining <- rest | [] -> failwith "unreachable" @@ -11506,7 +11506,7 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) : ILTypeRef option SourceConstructFlags.RecordType )) - if not (ilBaseTy.GenericArgs.IsEmpty) then + if not ilBaseTy.GenericArgs.IsEmpty then yield! GenAdditionalAttributesForTy g super ] @@ -11786,7 +11786,7 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) : ILTypeRef option // In this case, the .cctor for this type must force the .cctor of the backing static class for the file. if tycon.TyparsNoRange.IsEmpty - && not (eenv.realsig) + && not eenv.realsig && tycon.MembersOfFSharpTyconSorted |> List.exists (fun vref -> vref.Deref.IsClassConstructor) then diff --git a/src/Compiler/CodeGen/IlxGenSupport.fs b/src/Compiler/CodeGen/IlxGenSupport.fs index c4ffd7fc00d..ad10af9f823 100644 --- a/src/Compiler/CodeGen/IlxGenSupport.fs +++ b/src/Compiler/CodeGen/IlxGenSupport.fs @@ -94,14 +94,14 @@ let mkLocalPrivateAttributeWithPropertyConstructors |> List.map (fun (name, ilType) -> match codegenStyle with | PublicFields -> - (g.AddFieldGeneratedAttributes(mkILInstanceField (name, ilType, None, getFieldMemberAccess codegenStyle))), + g.AddFieldGeneratedAttributes(mkILInstanceField (name, ilType, None, getFieldMemberAccess codegenStyle)), [], [], (name, name, ilType, []) | EncapsulatedProperties -> let fieldName = name + "@" - (g.AddFieldGeneratedAttributes(mkILInstanceField (fieldName, ilType, None, getFieldMemberAccess codegenStyle))), + g.AddFieldGeneratedAttributes(mkILInstanceField (fieldName, ilType, None, getFieldMemberAccess codegenStyle)), [ g.AddMethodGeneratedAttributes( mkLdfldMethodDef ($"get_{name}", ILMemberAccess.Public, false, ilTy, fieldName, ilType, ILAttributes.Empty, []) @@ -206,7 +206,7 @@ let mkLocalPrivateAttributeWithByteAndByteArrayConstructors (g: TcGlobals, name: ILGenericParameterDefs.Empty, g.ilg.typ_Attribute, [], - mkILMethods ([ ilScalarCtorDef; ilArrayCtorDef ]), + mkILMethods [ ilScalarCtorDef; ilArrayCtorDef ], mkILFields [ fieldDef ], emptyILTypeDefs, emptyILProperties, @@ -216,7 +216,7 @@ let mkLocalPrivateAttributeWithByteAndByteArrayConstructors (g: TcGlobals, name: ) let mkLocalPrivateInt32Enum (g: TcGlobals, tref: ILTypeRef, values: (string * int32) array) = - let ilType = ILType.Value(mkILNonGenericTySpec (tref)) + let ilType = ILType.Value(mkILNonGenericTySpec tref) let enumFields = values @@ -261,7 +261,7 @@ let GetIsUnmanagedAttribute (g: TcGlobals) = let GetDynamicallyAccessedMemberTypes (g: TcGlobals) = let tref = g.enum_DynamicallyAccessedMemberTypes.TypeRef - if not (g.compilingFSharpCore) then + if not g.compilingFSharpCore then g.TryEmbedILType( tref, (fun () -> @@ -288,7 +288,7 @@ let GetDynamicallyAccessedMemberTypes (g: TcGlobals) = (mkLocalPrivateInt32Enum (g, tref, values)).WithSerializable(true).WithSealed(true)) ) - ILType.Value(mkILNonGenericTySpec (tref)) + ILType.Value(mkILNonGenericTySpec tref) let GetDynamicDependencyAttribute (g: TcGlobals) memberTypes (ilType: ILType) = let tref = g.attrib_DynamicDependencyAttribute.TypeRef @@ -303,7 +303,7 @@ let GetDynamicDependencyAttribute (g: TcGlobals) memberTypes (ilType: ILType) = ) let typIlMemberTypes = - ILType.Value(mkILNonGenericTySpec (g.enum_DynamicallyAccessedMemberTypes.TypeRef)) + ILType.Value(mkILNonGenericTySpec g.enum_DynamicallyAccessedMemberTypes.TypeRef) mkILCustomAttribute ( tref, diff --git a/src/Compiler/DependencyManager/AssemblyResolveHandler.fs b/src/Compiler/DependencyManager/AssemblyResolveHandler.fs index 75f8797341d..6daf749f87f 100644 --- a/src/Compiler/DependencyManager/AssemblyResolveHandler.fs +++ b/src/Compiler/DependencyManager/AssemblyResolveHandler.fs @@ -96,11 +96,11 @@ type AssemblyResolveHandlerDeskTop(assemblyProbingPaths: AssemblyResolutionProbe let handler = ResolveEventHandler(fun _ (args: ResolveEventArgs) -> resolveAssemblyNET (AssemblyName(args.Name))) - do AppDomain.CurrentDomain.add_AssemblyResolve (handler) + do AppDomain.CurrentDomain.add_AssemblyResolve handler interface IDisposable with member _x.Dispose() = - AppDomain.CurrentDomain.remove_AssemblyResolve (handler) + AppDomain.CurrentDomain.remove_AssemblyResolve handler type AssemblyResolveHandler internal (assemblyProbingPaths: AssemblyResolutionProbe option) = diff --git a/src/Compiler/DependencyManager/DependencyProvider.fs b/src/Compiler/DependencyManager/DependencyProvider.fs index 31daa3a3c60..4321e8e826e 100644 --- a/src/Compiler/DependencyManager/DependencyProvider.fs +++ b/src/Compiler/DependencyManager/DependencyProvider.fs @@ -494,13 +494,13 @@ type DependencyProvider // Resolution Path = Location of FSharp.Compiler.Service.dll let assemblySearchPaths = lazy - ([ + [ let assemblyLocation = typeof.GetTypeInfo().Assembly.Location yield !!(Path.GetDirectoryName assemblyLocation) yield AppDomain.CurrentDomain.BaseDirectory - ]) + ] let enumerateDependencyManagerAssemblies compilerTools (reportError: ResolvingErrorReport) = getCompilerToolsDesignTimeAssemblyPaths compilerTools @@ -628,7 +628,7 @@ type DependencyProvider path, null with e -> let e = stripTieWrapper e - let err, msg = FSComp.SR.packageManagerError (e.Message) + let err, msg = FSComp.SR.packageManagerError e.Message reportError.Invoke(ErrorReportType.Error, err, msg) null, null @@ -643,7 +643,7 @@ type DependencyProvider with e -> let e = stripTieWrapper e - let err, msg = FSComp.SR.packageManagerError (e.Message) + let err, msg = FSComp.SR.packageManagerError e.Message reportError.Invoke(ErrorReportType.Error, err, msg) null @@ -697,7 +697,7 @@ type DependencyProvider with e -> let e = stripTieWrapper e - Error(FSComp.SR.packageManagerError (e.Message))) + Error(FSComp.SR.packageManagerError e.Message)) ) match result with diff --git a/src/Compiler/DependencyManager/NativeDllResolveHandler.fs b/src/Compiler/DependencyManager/NativeDllResolveHandler.fs index 058dbedd0b7..6adeaf06a25 100644 --- a/src/Compiler/DependencyManager/NativeDllResolveHandler.fs +++ b/src/Compiler/DependencyManager/NativeDllResolveHandler.fs @@ -51,14 +51,14 @@ type internal ProbingPathsStore() = member this.Dispose() = let mutable probe: string = Unchecked.defaultof - while (addedPaths.TryTake(&probe)) do + while addedPaths.TryTake(&probe) do ProbingPathsStore.RemoveProbeFromProcessPath(probe) interface IDisposable with member _.Dispose() = let mutable probe: string = Unchecked.defaultof - while (addedPaths.TryTake(&probe)) do + while addedPaths.TryTake(&probe) do ProbingPathsStore.RemoveProbeFromProcessPath(probe) /// Signature for Native library resolution probe callback @@ -151,7 +151,7 @@ type internal NativeDllResolveHandlerCoreClr(nativeProbingRoots: NativeResolutio |> Seq.tryPick (fun rid -> probeForNativeLibrary root rid name))) match probe with - | Some path -> loadNativeLibrary (path) + | Some path -> loadNativeLibrary path | None -> IntPtr.Zero // netstandard 2.1 has this property, unfortunately we don't build with that yet diff --git a/src/Compiler/Driver/CompilerConfig.fs b/src/Compiler/Driver/CompilerConfig.fs index 325063e4b6f..045c4b60355 100644 --- a/src/Compiler/Driver/CompilerConfig.fs +++ b/src/Compiler/Driver/CompilerConfig.fs @@ -1054,7 +1054,7 @@ type TcConfigBuilder = member tcConfigB.AddReferencedAssemblyByPath(m, path) = if FileSystem.IsInvalidPathShim path then - warning (Error(FSComp.SR.buildInvalidAssemblyName (path), m)) + warning (Error(FSComp.SR.buildInvalidAssemblyName path, m)) elif not ( tcConfigB.referencedDLLs @@ -1182,7 +1182,7 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) = // Look for an explicit reference to mscorlib/netstandard.dll or System.Runtime.dll and use that to compute clrRoot and targetFrameworkVersion let primaryAssemblyReference, primaryAssemblyExplicitFilenameOpt = - computeKnownDllReference (data.primaryAssembly.Name) + computeKnownDllReference data.primaryAssembly.Name let fslibReference = // Look for explicit FSharp.Core reference otherwise use version that was referenced by compiler diff --git a/src/Compiler/Driver/CompilerDiagnostics.fs b/src/Compiler/Driver/CompilerDiagnostics.fs index e46cb1ad66b..71b0ba0eb2c 100644 --- a/src/Compiler/Driver/CompilerDiagnostics.fs +++ b/src/Compiler/Driver/CompilerDiagnostics.fs @@ -645,11 +645,11 @@ let OutputTypesNotInEqualityRelationContextInfo contextInfo ty1 ty2 m (os: Strin os.AppendString(FSComp.SR.arrayElementHasWrongType (ty1, ty2)) else os.AppendString(FSComp.SR.listElementHasWrongType (ty1, ty2)) - | ContextInfo.OmittedElseBranch range when equals range m -> os.AppendString(FSComp.SR.missingElseBranch (ty2)) + | ContextInfo.OmittedElseBranch range when equals range m -> os.AppendString(FSComp.SR.missingElseBranch ty2) | ContextInfo.ElseBranchResult range when equals range m -> os.AppendString(FSComp.SR.elseBranchHasWrongType (ty1, ty2)) | ContextInfo.FollowingPatternMatchClause range when equals range m -> os.AppendString(FSComp.SR.followingPatternMatchClauseHasWrongType (ty1, ty2)) - | ContextInfo.PatternMatchGuard range when equals range m -> os.AppendString(FSComp.SR.patternMatchGuardIsNotBool (ty2)) + | ContextInfo.PatternMatchGuard range when equals range m -> os.AppendString(FSComp.SR.patternMatchGuardIsNotBool ty2) | contextInfo -> fallback contextInfo type Exception with @@ -1086,7 +1086,7 @@ type Exception with | _ -> os.AppendString(NonRigidTypar3E().Format tpnm (NicePrint.stringOfTy denv ty2)) | SyntaxError(ctxt, _) -> - let ctxt = unbox> (ctxt) + let ctxt = unbox> ctxt let (|EndOfStructuredConstructToken|_|) token = match token with @@ -1725,7 +1725,7 @@ type Exception with os.AppendString(LetRecUnsound2E().Format (List.head path).DisplayName (bos.ToString())) - | LetRecEvaluatedOutOfOrder(_) -> os.AppendString(LetRecEvaluatedOutOfOrderE().Format) + | LetRecEvaluatedOutOfOrder _ -> os.AppendString(LetRecEvaluatedOutOfOrderE().Format) | LetRecCheckedAtRuntime _ -> os.AppendString(LetRecCheckedAtRuntimeE().Format) @@ -2218,7 +2218,7 @@ let CollectFormattedDiagnostics (tcConfig: TcConfig, severity: FSharpDiagnosticS |> fun lines -> Array.sub lines (m.StartLine - 1) (m.EndLine - m.StartLine - 1) |> Array.fold (fun (context, lineNumber) line -> (context + $"\n{lineNumber} | {line}", lineNumber + 1)) - ("", (m.StartLine)) + ("", m.StartLine) |> fst |> Some | None -> None diff --git a/src/Compiler/Driver/CompilerImports.fs b/src/Compiler/Driver/CompilerImports.fs index 321a5c645fb..667c0976551 100644 --- a/src/Compiler/Driver/CompilerImports.fs +++ b/src/Compiler/Driver/CompilerImports.fs @@ -663,9 +663,9 @@ type TcConfig with // First, try to resolve everything as a file using simple resolution let resolvedAsFile = [| - for (_filename, maxIndexOfReference, references) in groupedReferences do + for _filename, maxIndexOfReference, references in groupedReferences do let assemblyResolution = - references |> List.choose (tcConfig.TryResolveLibWithDirectories) + references |> List.choose tcConfig.TryResolveLibWithDirectories if not assemblyResolution.IsEmpty then (maxIndexOfReference, assemblyResolution) @@ -739,7 +739,7 @@ type TcConfig with let unresolved = [ - for (name, _, r) in unresolvedReferences -> UnresolvedAssemblyReference(name, r) + for name, _, r in unresolvedReferences -> UnresolvedAssemblyReference(name, r) ] // If mode=Speculative, then we haven't reported any errors. @@ -1166,7 +1166,7 @@ type TcImportsWeakFacade(tciLock: TcImportsLock, tcImportsWeak: WeakReference @@ -1177,7 +1177,7 @@ type TcImportsWeakFacade(tciLock: TcImportsLock, tcImportsWeak: WeakReference @@ -1520,7 +1520,7 @@ and [] TcImports { IsFSharp = false UsesFSharp20PlusQuotations = false - InvalidateEvent = (Event<_>()).Publish + InvalidateEvent = Event<_>().Publish IsProviderGenerated = true QualifiedName = Some(assembly.PUntaint((fun a -> a.FullName), m)) Contents = ccuContents @@ -1863,7 +1863,7 @@ and [] TcImports let tcImports = tcImportsWeak // The name of this captured value must not change, see comments on TcImportsWeakFacade above - assert (nameof (tcImports) = "tcImports") + assert (nameof tcImports = "tcImports") let mutable systemRuntimeContainsTypeRef = tcImports.SystemRuntimeContainsType @@ -2687,7 +2687,7 @@ let RequireReferences (ctok, tcImports: TcImports, tcEnv, thisAssemblyName, reso ccuinfos |> List.map (function | ResolvedImportedAssembly(asm, m) -> asm, m - | UnresolvedImportedAssembly(assemblyName, m) -> error (Error(FSComp.SR.buildCouldNotResolveAssembly (assemblyName), m))) + | UnresolvedImportedAssembly(assemblyName, m) -> error (Error(FSComp.SR.buildCouldNotResolveAssembly assemblyName, m))) let g = tcImports.GetTcGlobals() let amap = tcImports.GetImportMap() diff --git a/src/Compiler/Driver/CompilerOptions.fs b/src/Compiler/Driver/CompilerOptions.fs index efaf3a7009f..7632a35da6b 100644 --- a/src/Compiler/Driver/CompilerOptions.fs +++ b/src/Compiler/Driver/CompilerOptions.fs @@ -320,7 +320,7 @@ let ParseCompilerOptions (collectOtherArgument: string -> unit, blocks: Compiler opt let getSwitch (s: string) = - let s = (s.Split([| ':' |]))[0] + let s = s.Split([| ':' |])[0] if s <> "--" && s.EndsWithOrdinal("-") then OptionSwitch.Off @@ -623,7 +623,7 @@ let callVirtSwitch (tcConfigB: TcConfigBuilder) switch = let callParallelCompilationSwitch (tcConfigB: TcConfigBuilder) switch = tcConfigB.parallelIlxGen <- switch = OptionSwitch.On - let (graphCheckingMode, optMode) = + let graphCheckingMode, optMode = match switch with | OptionSwitch.On -> TypeCheckingMode.Graph, OptimizationProcessingMode.Parallel | OptionSwitch.Off -> TypeCheckingMode.Sequential, OptimizationProcessingMode.Sequential @@ -1174,7 +1174,7 @@ let languageFlags tcConfigB = CompilerOption( "langversion", tagLangVersionValues, - OptionString(fun switch -> tcConfigB.langVersion <- setLanguageVersion (switch)), + OptionString(fun switch -> tcConfigB.langVersion <- setLanguageVersion switch), None, Some(FSComp.SR.optsSetLangVersion ()) ) @@ -1545,7 +1545,7 @@ let internalFlags (tcConfigB: TcConfigBuilder) = CompilerOption( "bufferwidth", tagNone, - OptionInt((fun v -> tcConfigB.bufferWidth <- Some v)), + OptionInt(fun v -> tcConfigB.bufferWidth <- Some v), Some(InternalCommandLineOption("--bufferWidth", rangeCmdArgs)), None ) @@ -2179,29 +2179,29 @@ let miscFlagsFsi tcConfigB = miscFlagsBoth tcConfigB let abbreviatedFlagsBoth tcConfigB = [ - CompilerOption("d", tagString, OptionString(defineSymbol tcConfigB), None, Some(FSComp.SR.optsShortFormOf ("--define"))) - CompilerOption("O", tagNone, OptionSwitch(SetOptimizeSwitch tcConfigB), None, Some(FSComp.SR.optsShortFormOf ("--optimize[+|-]"))) - CompilerOption("g", tagNone, OptionSwitch(SetDebugSwitch tcConfigB None), None, Some(FSComp.SR.optsShortFormOf ("--debug"))) + CompilerOption("d", tagString, OptionString(defineSymbol tcConfigB), None, Some(FSComp.SR.optsShortFormOf "--define")) + CompilerOption("O", tagNone, OptionSwitch(SetOptimizeSwitch tcConfigB), None, Some(FSComp.SR.optsShortFormOf "--optimize[+|-]")) + CompilerOption("g", tagNone, OptionSwitch(SetDebugSwitch tcConfigB None), None, Some(FSComp.SR.optsShortFormOf "--debug")) CompilerOption( "i", tagString, OptionUnit(fun () -> tcConfigB.printSignature <- true), None, - Some(FSComp.SR.optsShortFormOf ("--sig")) + Some(FSComp.SR.optsShortFormOf "--sig") ) CompilerOption( "r", tagFile, OptionString(fun s -> tcConfigB.AddReferencedAssemblyByPath(rangeStartup, s)), None, - Some(FSComp.SR.optsShortFormOf ("--reference")) + Some(FSComp.SR.optsShortFormOf "--reference") ) CompilerOption( "I", tagDirList, OptionStringList(fun s -> tcConfigB.AddIncludePath(rangeStartup, s, tcConfigB.implicitIncludeDir)), None, - Some(FSComp.SR.optsShortFormOf ("--lib")) + Some(FSComp.SR.optsShortFormOf "--lib") ) ] @@ -2210,14 +2210,14 @@ let abbreviatedFlagsFsi tcConfigB = abbreviatedFlagsBoth tcConfigB let abbreviatedFlagsFsc tcConfigB = abbreviatedFlagsBoth tcConfigB @ [ // FSC only abbreviated options - CompilerOption("o", tagString, OptionString(setOutFileName tcConfigB), None, Some(FSComp.SR.optsShortFormOf ("--out"))) + CompilerOption("o", tagString, OptionString(setOutFileName tcConfigB), None, Some(FSComp.SR.optsShortFormOf "--out")) CompilerOption( "a", tagString, OptionUnit(fun () -> tcConfigB.target <- CompilerTarget.Dll), None, - Some(FSComp.SR.optsShortFormOf ("--target library")) + Some(FSComp.SR.optsShortFormOf "--target library") ) // FSC help abbreviations. FSI has its own help options... @@ -2228,7 +2228,7 @@ let abbreviatedFlagsFsc tcConfigB = Console.Write(GetHelpFsc tcConfigB blocks) tcConfigB.exiter.Exit 0), None, - Some(FSComp.SR.optsShortFormOf ("--help")) + Some(FSComp.SR.optsShortFormOf "--help") ) CompilerOption( @@ -2238,7 +2238,7 @@ let abbreviatedFlagsFsc tcConfigB = Console.Write(GetHelpFsc tcConfigB blocks) tcConfigB.exiter.Exit 0), None, - Some(FSComp.SR.optsShortFormOf ("--help")) + Some(FSComp.SR.optsShortFormOf "--help") ) CompilerOption( @@ -2248,7 +2248,7 @@ let abbreviatedFlagsFsc tcConfigB = Console.Write(GetHelpFsc tcConfigB blocks) tcConfigB.exiter.Exit 0), None, - Some(FSComp.SR.optsShortFormOf ("--help")) + Some(FSComp.SR.optsShortFormOf "--help") ) ] diff --git a/src/Compiler/Driver/CreateILModule.fs b/src/Compiler/Driver/CreateILModule.fs index 6c7dfeb31b6..81889b958e3 100644 --- a/src/Compiler/Driver/CreateILModule.fs +++ b/src/Compiler/Driver/CreateILModule.fs @@ -226,7 +226,7 @@ module MainModuleBuilder = { ScopeRef = ILScopeRef.Assembly systemNumericsAssemblyRef Name = t - Attributes = enum (0x00200000) ||| TypeAttributes.Public + Attributes = enum 0x00200000 ||| TypeAttributes.Public Nested = mkILNestedExportedTypes [] CustomAttrsStored = storeILCustomAttrs emptyILCustomAttrs MetadataIndex = NoMetadataIdx @@ -598,8 +598,8 @@ module MainModuleBuilder = // don't embed a manifest if target is not an exe, if manifest is specifically excluded, if another native resource is being included, or if running on mono elif - not (tcConfig.target.IsExe) - || not (tcConfig.includewin32manifest) + not tcConfig.target.IsExe + || not tcConfig.includewin32manifest || not (String.IsNullOrEmpty(tcConfig.win32res)) then "" @@ -629,10 +629,10 @@ module MainModuleBuilder = [| yield! ResFileFormat.ResFileHeader() yield! - (ManifestResourceFormat.VS_MANIFEST_RESOURCE( - (FileSystem.OpenFileForReadShim(win32Manifest).ReadAllBytes()), + ManifestResourceFormat.VS_MANIFEST_RESOURCE( + FileSystem.OpenFileForReadShim(win32Manifest).ReadAllBytes(), tcConfig.target = CompilerTarget.Dll - )) + ) |] if String.IsNullOrEmpty(tcConfig.win32res) diff --git a/src/Compiler/Driver/FxResolver.fs b/src/Compiler/Driver/FxResolver.fs index 906181cec99..c504d4cb77e 100644 --- a/src/Compiler/Driver/FxResolver.fs +++ b/src/Compiler/Driver/FxResolver.fs @@ -246,7 +246,7 @@ type internal FxResolver getRunningImplementationAssemblyDir (), warnings with e -> let warn = - Error(FSComp.SR.scriptSdkNotDeterminedUnexpected (e.Message), rangeForErrors) + Error(FSComp.SR.scriptSdkNotDeterminedUnexpected e.Message, rangeForErrors) let path = getRunningImplementationAssemblyDir () path, [ warn ] @@ -371,7 +371,7 @@ type internal FxResolver | None -> (None, None), warnings with e -> let warn = - Error(FSComp.SR.scriptSdkNotDeterminedUnexpected (e.Message), rangeForErrors) + Error(FSComp.SR.scriptSdkNotDeterminedUnexpected e.Message, rangeForErrors) // This is defensive coding, we don't expect this exception to happen // NOTE: consider reporting this exception as a warning (None, None), [ warn ] @@ -458,7 +458,7 @@ type internal FxResolver | None -> None, warnings with e -> let warn = - Error(FSComp.SR.scriptSdkNotDeterminedUnexpected (e.Message), rangeForErrors) + Error(FSComp.SR.scriptSdkNotDeterminedUnexpected e.Message, rangeForErrors) // This is defensive coding, we don't expect this exception to happen // NOTE: consider reporting this exception as a warning None, warnings @ [ warn ] @@ -936,7 +936,7 @@ type internal FxResolver sdkReferences, false with e -> - warning (Error(FSComp.SR.scriptSdkNotDeterminedUnexpected (e.Message), rangeForErrors)) + warning (Error(FSComp.SR.scriptSdkNotDeterminedUnexpected e.Message, rangeForErrors)) // This is defensive coding, we don't expect this exception to happen if isRunningOnCoreClr then // If running on .NET Core and something goes wrong with getting the diff --git a/src/Compiler/Driver/ParseAndCheckInputs.fs b/src/Compiler/Driver/ParseAndCheckInputs.fs index 2256a3e8ad6..9cb8fb51f59 100644 --- a/src/Compiler/Driver/ParseAndCheckInputs.fs +++ b/src/Compiler/Driver/ParseAndCheckInputs.fs @@ -222,7 +222,7 @@ let FinishPreprocessing lexbuf diagnosticOptions isScript submoduleRanges = let private collectParsedInputTrivia lexbuf = { ConditionalDirectives = IfdefStore.GetTrivia(lexbuf) - WarnDirectives = WarnScopes.getDirectiveTrivia (lexbuf) + WarnDirectives = WarnScopes.getDirectiveTrivia lexbuf CodeComments = let tripleSlashComments = XmlDocStore.ReportInvalidXmlDocPositions(lexbuf) @@ -836,7 +836,7 @@ let ProcessMetaCommandsFromInput state - | ParsedHashDirective(("reference" | "r") as c, [], m) -> + | ParsedHashDirective("reference" | "r" as c, [], m) -> if not canHaveScriptMetaCommands then errorR (HashDirectiveNotAllowedInNonScript m) else @@ -1091,7 +1091,7 @@ let GetInitialTcState (m, ccuName, tcConfig: TcConfig, tcGlobals, tcImports: TcI IsFSharp = true UsesFSharp20PlusQuotations = false #if !NO_TYPEPROVIDERS - InvalidateEvent = (Event<_>()).Publish + InvalidateEvent = Event<_>().Publish IsProviderGenerated = false ImportProvidedType = (fun ty -> Import.ImportProvidedType (tcImports.GetImportMap()) m ty) #endif @@ -1188,7 +1188,7 @@ let SkippedImplFilePlaceholder (tcConfig: TcConfig, tcImports: TcImports, tcGlob // Check if we've already seen an implementation for this fragment if Zset.contains qualNameOfFile tcState.tcsRootImpls then - errorR (Error(FSComp.SR.buildImplementationAlreadyGiven (qualNameOfFile.Text), input.Range)) + errorR (Error(FSComp.SR.buildImplementationAlreadyGiven qualNameOfFile.Text, input.Range)) let hadSig = rootSigOpt.IsSome @@ -1248,11 +1248,11 @@ let CheckOneInput // Check if we've seen this top module signature before. if Zmap.mem qualNameOfFile tcState.tcsRootSigs then - errorR (Error(FSComp.SR.buildSignatureAlreadySpecified (qualNameOfFile.Text), m.StartRange)) + errorR (Error(FSComp.SR.buildSignatureAlreadySpecified qualNameOfFile.Text, m.StartRange)) // Check if the implementation came first in compilation order if Zset.contains qualNameOfFile tcState.tcsRootImpls then - errorR (Error(FSComp.SR.buildImplementationAlreadyGivenDetail (qualNameOfFile.Text), m)) + errorR (Error(FSComp.SR.buildImplementationAlreadyGivenDetail qualNameOfFile.Text, m)) // Typecheck the signature file let! tcEnv, sigFileType, createsGeneratedProvidedTypes = @@ -1299,7 +1299,7 @@ let CheckOneInput // Check if we've already seen an implementation for this fragment if Zset.contains qualNameOfFile tcState.tcsRootImpls then - errorR (Error(FSComp.SR.buildImplementationAlreadyGiven (qualNameOfFile.Text), m)) + errorR (Error(FSComp.SR.buildImplementationAlreadyGiven qualNameOfFile.Text, m)) let hadSig = rootSigOpt.IsSome @@ -1386,7 +1386,7 @@ let CheckClosedInputSetFinish (declaredImpls: CheckedImplFile list, tcState) = tcState.tcsRootSigs |> Zmap.iter (fun qualNameOfFile _ -> if not (Zset.contains qualNameOfFile tcState.tcsRootImpls) then - errorR (Error(FSComp.SR.buildSignatureWithoutImplementation (qualNameOfFile.Text), qualNameOfFile.Range))) + errorR (Error(FSComp.SR.buildSignatureWithoutImplementation qualNameOfFile.Text, qualNameOfFile.Range))) tcState, declaredImpls, ccuContents @@ -1465,11 +1465,11 @@ let CheckOneInputWithCallback // Check if we've seen this top module signature before. if Zmap.mem qualNameOfFile tcState.tcsRootSigs then - errorR (Error(FSComp.SR.buildSignatureAlreadySpecified (qualNameOfFile.Text), m.StartRange)) + errorR (Error(FSComp.SR.buildSignatureAlreadySpecified qualNameOfFile.Text, m.StartRange)) // Check if the implementation came first in compilation order if Zset.contains qualNameOfFile tcState.tcsRootImpls then - errorR (Error(FSComp.SR.buildImplementationAlreadyGivenDetail (qualNameOfFile.Text), m)) + errorR (Error(FSComp.SR.buildImplementationAlreadyGivenDetail qualNameOfFile.Text, m)) // Typecheck the signature file let! tcEnv, sigFileType, createsGeneratedProvidedTypes = @@ -1547,7 +1547,7 @@ let CheckOneInputWithCallback (fun tcState -> // Check if we've already seen an implementation for this fragment if Zset.contains qualNameOfFile tcState.tcsRootImpls then - errorR (Error(FSComp.SR.buildImplementationAlreadyGiven (qualNameOfFile.Text), m)) + errorR (Error(FSComp.SR.buildImplementationAlreadyGiven qualNameOfFile.Text, m)) let ccuSigForFile, fsTcState = AddCheckResultsToTcState @@ -1824,7 +1824,7 @@ let CheckMultipleInputsUsingGraphMode use _ = UseDiagnosticsLogger logger let checkForErrors2 () = - priorErrors || (logger.CheckForRealErrorsIgnoringWarnings) + priorErrors || logger.CheckForRealErrorsIgnoringWarnings let tcSink = TcResultsSink.NoSink diff --git a/src/Compiler/Driver/ScriptClosure.fs b/src/Compiler/Driver/ScriptClosure.fs index 537e34551cf..2f3778bb1db 100644 --- a/src/Compiler/Driver/ScriptClosure.fs +++ b/src/Compiler/Driver/ScriptClosure.fs @@ -435,7 +435,7 @@ module ScriptPreprocessClosure = // Send outputs via diagnostics if (result.StdOut.Length > 0 || result.StdError.Length > 0) then for line in Array.append result.StdOut result.StdError do - errorR (Error(FSComp.SR.packageManagerError (line), m)) + errorR (Error(FSComp.SR.packageManagerError line, m)) // Resolution produced errors update packagerManagerLines entries to note these failure // failed resolutions will no longer be considered let tcConfigB = tcConfig.CloneToBuilder() diff --git a/src/Compiler/Driver/StaticLinking.fs b/src/Compiler/Driver/StaticLinking.fs index c7139d28793..ebc8287b974 100644 --- a/src/Compiler/Driver/StaticLinking.fs +++ b/src/Compiler/Driver/StaticLinking.fs @@ -117,7 +117,7 @@ let StaticLinkILModules | _ -> None) match dependentCcuUsingQuotations with - | Some ccu -> error (Error(FSComp.SR.fscQuotationLiteralsStaticLinking (ccu.AssemblyName), rangeStartup)) + | Some ccu -> error (Error(FSComp.SR.fscQuotationLiteralsStaticLinking ccu.AssemblyName, rangeStartup)) | None -> () // Check we're not static linking a .EXE @@ -382,7 +382,7 @@ let FindDependentILModulesForStaticLinking (ctok, tcConfig: TcConfig, tcImports: remaining <- Array.toList refs.AssemblyReferences @ remaining | None -> - warning (Error(FSComp.SR.fscAssumeStaticLinkContainsNoDependencies (ilAssemRef.Name), rangeStartup)) + warning (Error(FSComp.SR.fscAssumeStaticLinkContainsNoDependencies ilAssemRef.Name, rangeStartup)) depModuleTable[ilAssemRef.Name] <- dummyEntry ilAssemRef.Name ReportTime tcConfig "Find dependencies" diff --git a/src/Compiler/Driver/XmlDocFileWriter.fs b/src/Compiler/Driver/XmlDocFileWriter.fs index 8a3eb618b4c..004293087bf 100644 --- a/src/Compiler/Driver/XmlDocFileWriter.fs +++ b/src/Compiler/Driver/XmlDocFileWriter.fs @@ -139,7 +139,7 @@ module XmlDocWriter = fprintfn os "%s" assemblyName fprintfn os "" - for (nm, doc) in members do + for nm, doc in members do fprintfn os "" nm fprintfn os "%s" doc fprintfn os "" diff --git a/src/Compiler/Driver/fsc.fs b/src/Compiler/Driver/fsc.fs index 89f196c810f..198b74601c4 100644 --- a/src/Compiler/Driver/fsc.fs +++ b/src/Compiler/Driver/fsc.fs @@ -860,14 +860,14 @@ let main3 AbortOnError(diagnosticsLogger, exiter) // Encode the optimization data - ReportTime tcConfig ("Encoding OptData") + ReportTime tcConfig "Encoding OptData" optimizedImpls, EncodeOptimizationData(tcGlobals, tcConfig, outfile, exportRemapping, (generatedCcu, optimizationData), false) if tcGlobals.langVersion.SupportsFeature LanguageFeature.WarningWhenTailRecAttributeButNonTailRecUsage then match optimizedImpls with | CheckedAssemblyAfterOptimization checkedImplFileAfterOptimizations -> - ReportTime tcConfig ("TailCall Checks") + ReportTime tcConfig "TailCall Checks" for f in checkedImplFileAfterOptimizations do TailCallChecks.CheckImplFile(tcGlobals, tcImports.GetImportMap(), true, f.ImplFile.Contents) diff --git a/src/Compiler/Facilities/AsyncMemoize.fs b/src/Compiler/Facilities/AsyncMemoize.fs index c7ebc55bda3..16f4787209d 100644 --- a/src/Compiler/Facilities/AsyncMemoize.fs +++ b/src/Compiler/Facilities/AsyncMemoize.fs @@ -332,7 +332,7 @@ type internal AsyncMemoize<'TKey, 'TVersion, 'TValue if requests = 0 then "" else - $" (%.0f{float hits / (float (requests)) * 100.0} %%)" + $" (%.0f{float hits / (float requests) * 100.0} %%)" let faulted = getStat "Faulted" let failed = eventCounts[Failed].Value diff --git a/src/Compiler/Facilities/AsyncMemoize.fsi b/src/Compiler/Facilities/AsyncMemoize.fsi index b83e21ba0e8..dd7b6c821da 100644 --- a/src/Compiler/Facilities/AsyncMemoize.fsi +++ b/src/Compiler/Facilities/AsyncMemoize.fsi @@ -31,7 +31,7 @@ type internal ICacheKey<'TKey, 'TVersion> = type Extensions = [] - static member internal WithExtraVersion: cacheKey: ICacheKey<'a, 'b> * extraVersion: 'c -> ICacheKey<'a, ('b * 'c)> + static member internal WithExtraVersion: cacheKey: ICacheKey<'a, 'b> * extraVersion: 'c -> ICacheKey<'a, 'b * 'c> /// /// A cache/memoization for computations that makes sure that the same computation will only be computed once even if it's needed diff --git a/src/Compiler/Facilities/DiagnosticResolutionHints.fs b/src/Compiler/Facilities/DiagnosticResolutionHints.fs index e605ace0b5c..97068cfea2d 100644 --- a/src/Compiler/Facilities/DiagnosticResolutionHints.fs +++ b/src/Compiler/Facilities/DiagnosticResolutionHints.fs @@ -57,7 +57,7 @@ type SuggestionBufferEnumerator(tail: int, data: KeyValuePair[]) member _.Dispose() = () type SuggestionBuffer(idText: string) = - let data = Array.zeroCreate> (maxSuggestions) + let data = Array.zeroCreate> maxSuggestions let mutable tail = maxSuggestions - 1 let uppercaseText = idText.ToUpperInvariant() let dotIdText = "." + idText diff --git a/src/Compiler/Facilities/DiagnosticsLogger.fs b/src/Compiler/Facilities/DiagnosticsLogger.fs index 1fc27dc82f4..58d24ddaaa7 100644 --- a/src/Compiler/Facilities/DiagnosticsLogger.fs +++ b/src/Compiler/Facilities/DiagnosticsLogger.fs @@ -915,7 +915,7 @@ module StackGuardMetrics = let data = [ for kvp in dataByFunctionName do - let (memberName, source) = kvp.Key + let memberName, source = kvp.Key let jumps, depth = kvp.Value [ memberName; source; string jumps.Value; string depth.Value ] ] diff --git a/src/Compiler/Facilities/prim-lexing.fs b/src/Compiler/Facilities/prim-lexing.fs index 90c7654bd65..cfde35d5a77 100644 --- a/src/Compiler/Facilities/prim-lexing.fs +++ b/src/Compiler/Facilities/prim-lexing.fs @@ -509,7 +509,7 @@ type internal UnicodeTables(trans: uint16[] array, accept: uint16[]) = // 1 entry for EOF member tables.Interpret(initialState, lexBuffer: LexBuffer) = - startInterpret (lexBuffer) + startInterpret lexBuffer scanUntilSentinel lexBuffer initialState static member Create(trans, accept) = UnicodeTables(trans, accept) diff --git a/src/Compiler/Facilities/prim-parsing.fs b/src/Compiler/Facilities/prim-parsing.fs index 632832b8d85..fc6eb237c2d 100644 --- a/src/Compiler/Facilities/prim-parsing.fs +++ b/src/Compiler/Facilities/prim-parsing.fs @@ -99,7 +99,7 @@ type internal Tables<'Token> = // type Stack<'a> = System.Collections.Generic.Stack<'a> type Stack<'a>(n) = - let mutable contents = Array.zeroCreate<'a> (n) + let mutable contents = Array.zeroCreate<'a> n let mutable count = 0 member buf.Ensure newSize = @@ -331,7 +331,7 @@ module internal Implementation = | None -> true | Some(token) -> let nextState = actionValue action - actionKind (actionTable.Read(nextState, tables.tagOfToken (token))) = shiftFlag) + actionKind (actionTable.Read(nextState, tables.tagOfToken token)) = shiftFlag) then if Flags.debug then @@ -351,7 +351,7 @@ module internal Implementation = valueStack.Pop() stateStack.Pop() - popStackUntilErrorShifted (tokenOpt) + popStackUntilErrorShifted tokenOpt while not finished do if stateStack.IsEmpty then @@ -483,7 +483,7 @@ module internal Implementation = if Flags.debug then Console.WriteLine("RecoverableParseErrorException...\n") - popStackUntilErrorShifted (None) + popStackUntilErrorShifted None // User code raised a Parse_error. Don't report errors again until three tokens have been shifted errorSuppressionCountDown <- 3 elif kind = errorFlag then @@ -543,9 +543,9 @@ module internal Implementation = let reduceTokens = [ for tag, action in actions do - if actionKind (action) = reduceFlag then + if actionKind action = reduceFlag then yield tag - if actionKind (defaultAction) = reduceFlag then + if actionKind defaultAction = reduceFlag then for tag in 0 .. tables.numTerminals - 1 do if not (explicit.Contains(tag)) then yield tag @@ -562,8 +562,8 @@ module internal Implementation = "syntax error" ) - tables.parseError (errorContext) - popStackUntilErrorShifted (None) + tables.parseError errorContext + popStackUntilErrorShifted None errorSuppressionCountDown <- 3 if Flags.debug then diff --git a/src/Compiler/Interactive/FSharpInteractiveServer.fs b/src/Compiler/Interactive/FSharpInteractiveServer.fs index 947bbe04b6b..fbe33275289 100644 --- a/src/Compiler/Interactive/FSharpInteractiveServer.fs +++ b/src/Compiler/Interactive/FSharpInteractiveServer.fs @@ -30,7 +30,7 @@ module CtrlBreakHandlers = use stream = new StreamReader(service) try - while not (stream.EndOfStream) do + while not stream.EndOfStream do let line = stream.ReadLine() if line = interruptCommand then @@ -49,7 +49,7 @@ module CtrlBreakHandlers = | None -> () | Some client -> try - if not (client.IsConnected) then + if not client.IsConnected then client.Connect(connectionTimeout) with _ -> () diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index 296a3dbfc1e..b49c0f83db9 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -909,7 +909,7 @@ type internal DiagnosticsLoggerThatStopsOnFirstError exit 1 (* non-zero exit code *) // STOP ON FIRST ERROR (AVOIDS PARSER ERROR RECOVERY) raise StopProcessing - | (FSharpDiagnosticSeverity.Warning | FSharpDiagnosticSeverity.Info) as adjustedSeverity -> + | FSharpDiagnosticSeverity.Warning | FSharpDiagnosticSeverity.Info as adjustedSeverity -> DoWithDiagnosticColor adjustedSeverity (fun () -> fsiConsoleOutput.Error.WriteLine() diagnostic.WriteWithContext(fsiConsoleOutput.Error, " ", fsiStdinSyphon.GetLine, tcConfig, severity) @@ -1004,7 +1004,7 @@ type internal FsiCommandLineOptions(fsi: FsiEvaluationSessionHostConfig, argv: s let displayHelpFsi tcConfigB (blocks: CompilerOptionBlock list) = Console.Write(GetBannerText tcConfigB) fprintfn fsiConsoleOutput.Out "" - fprintfn fsiConsoleOutput.Out "%s" (FSIstrings.SR.fsiUsage (executableFileNameWithoutExtension.Value)) + fprintfn fsiConsoleOutput.Out "%s" (FSIstrings.SR.fsiUsage executableFileNameWithoutExtension.Value) Console.Write(GetCompilerOptionBlocks blocks tcConfigB.bufferWidth) fprintfn fsiConsoleOutput.Out "" fprintfn fsiConsoleOutput.Out "%s" (FSIstrings.SR.fsiDetailedHelpLink ()) @@ -1259,7 +1259,7 @@ type internal FsiCommandLineOptions(fsi: FsiEvaluationSessionHostConfig, argv: s fsiConsoleOutput.uprintfn """ #quit;; // %s""" (FSIstrings.SR.fsiIntroTextHashquitInfo ()) fsiConsoleOutput.uprintfn "" fsiConsoleOutput.uprintfnn "%s" (FSIstrings.SR.fsiIntroTextHeader2commandLine ()) - fsiConsoleOutput.uprintfn "%s" (FSIstrings.SR.fsiIntroTextHeader3 (helpLine)) + fsiConsoleOutput.uprintfn "%s" (FSIstrings.SR.fsiIntroTextHeader3 helpLine) fsiConsoleOutput.uprintfn "" fsiConsoleOutput.uprintfn "" @@ -1408,7 +1408,7 @@ type internal FsiConsolePrompt(fsiOptions: FsiCommandLineOptions, fsiConsoleOutp // # silentPrompt member _.ShowPrompt with get () = showPrompt - and set (value) = showPrompt <- value + and set value = showPrompt <- value member _.SkipNext() = if showPrompt then @@ -1445,25 +1445,25 @@ type internal FsiConsoleInput do if fsiOptions.Interact then if fsiOptions.PeekAheadOnConsoleToPermitTyping then - (Thread(fun () -> - match consoleOpt with - | Some console when fsiOptions.EnableConsoleKeyProcessing && not fsiOptions.UseServerPrompt -> - if List.isEmpty fsiOptions.SourceFiles then - if progress then - fprintfn outWriter "first-line-reader-thread reading first line..." + Thread(fun () -> + match consoleOpt with + | Some console when fsiOptions.EnableConsoleKeyProcessing && not fsiOptions.UseServerPrompt -> + if List.isEmpty fsiOptions.SourceFiles then + if progress then + fprintfn outWriter "first-line-reader-thread reading first line..." - firstLine <- Some(console ()) + firstLine <- Some(console ()) - if progress then - fprintfn outWriter "first-line-reader-thread got first line = %A..." firstLine + if progress then + fprintfn outWriter "first-line-reader-thread got first line = %A..." firstLine - consoleReaderStartupDone.Set() |> ignore + consoleReaderStartupDone.Set() |> ignore - if progress then - fprintfn outWriter "first-line-reader-thread has set signal and exited." - | _ -> - ignore (inReader.Peek()) - consoleReaderStartupDone.Set() |> ignore)) + if progress then + fprintfn outWriter "first-line-reader-thread has set signal and exited." + | _ -> + ignore (inReader.Peek()) + consoleReaderStartupDone.Set() |> ignore) .Start() else if progress then @@ -1614,7 +1614,7 @@ let internal mkBoundValueTypedImpl tcGlobals m moduleName name ty = let vis = Accessibility.TAccess([]) let compPath = - (CompilationPath.CompPath(ILScopeRef.Local, SyntaxAccess.Unknown, [])) + CompilationPath.CompPath(ILScopeRef.Local, SyntaxAccess.Unknown, []) let mutable mty = Unchecked.defaultof<_> @@ -1675,7 +1675,7 @@ let internal mkBoundValueTypedImpl tcGlobals m moduleName name ty = let qname = QualifiedNameOfFile.QualifiedNameOfFile(Ident(moduleName, m)) entity, v, CheckedImplFile.CheckedImplFile(qname, mty, contents, false, false, StampMap.Empty, Map.empty) -let dynamicCcuName (isEmitMulti) = +let dynamicCcuName isEmitMulti = $"""FSI-ASSEMBLY{if isEmitMulti then "-MULTI" else ""}""" /// Encapsulates the coordination of the typechecking, optimization and code generation @@ -1727,7 +1727,7 @@ type internal FsiDynamicCompiler else let assemBuilder, moduleBuilder = mkDynamicAssemblyAndModule ( - dynamicCcuName (tcConfigB.fsiMultiAssemblyEmit), + dynamicCcuName tcConfigB.fsiMultiAssemblyEmit, tcConfigB.optSettings.LocalOptimizationsEnabled, fsiCollectible ) @@ -1820,7 +1820,7 @@ type internal FsiDynamicCompiler let attrs = [ - tcGlobals.MakeInternalsVisibleToAttribute(dynamicCcuName (tcConfigB.fsiMultiAssemblyEmit)) + tcGlobals.MakeInternalsVisibleToAttribute(dynamicCcuName tcConfigB.fsiMultiAssemblyEmit) yield! manifest.CustomAttrs.AsList() ] @@ -1867,7 +1867,7 @@ type internal FsiDynamicCompiler let asm = match opts.pdbfile, pdbBytes with - | (Some pdbfile), (Some pdbBytes) -> + | Some pdbfile, Some pdbBytes -> File.WriteAllBytes(pdbfile, pdbBytes) #if FOR_TESTING Directory.CreateDirectory(scriptingSymbolsPath.Value) |> ignore @@ -1969,7 +1969,7 @@ type internal FsiDynamicCompiler ReportTime tcConfig "Linking" let ilxMainModule = - CreateModuleFragment(tcConfigB, dynamicCcuName (tcConfigB.fsiMultiAssemblyEmit), codegenResults) + CreateModuleFragment(tcConfigB, dynamicCcuName tcConfigB.fsiMultiAssemblyEmit, codegenResults) diagnosticsLogger.AbortOnError(fsiConsoleOutput) @@ -2607,7 +2607,7 @@ type internal FsiDynamicCompiler // Check the file can be resolved if FileSystem.IsInvalidPathShim(path) then - error (Error(FSIstrings.SR.fsiInvalidAssembly (path), m)) + error (Error(FSIstrings.SR.fsiInvalidAssembly path, m)) // Do the resolution let resolutions = @@ -2628,7 +2628,7 @@ type internal FsiDynamicCompiler // Print the explicit assembly resolutions. Only for explicit '#r' in direct inputs, not those // in #load files. This means those resulting from nuget package resolution are not shown. - for (_, resolutions, show, _) in refs do + for _, resolutions, show, _ in refs do if show then for ar in resolutions do let format = @@ -2639,32 +2639,32 @@ type internal FsiDynamicCompiler match reportedAssemblies.TryGetValue resolvedPath with | false, _ -> reportedAssemblies.Add(resolvedPath, fileTime) - FSIstrings.SR.fsiDidAHashr (ar.resolvedPath) - | true, time when time <> fileTime -> FSIstrings.SR.fsiDidAHashrWithStaleWarning (ar.resolvedPath) - | _ -> FSIstrings.SR.fsiDidAHashr (ar.resolvedPath) + FSIstrings.SR.fsiDidAHashr ar.resolvedPath + | true, time when time <> fileTime -> FSIstrings.SR.fsiDidAHashrWithStaleWarning ar.resolvedPath + | _ -> FSIstrings.SR.fsiDidAHashr ar.resolvedPath else - FSIstrings.SR.fsiDidAHashrWithLockWarning (ar.resolvedPath) + FSIstrings.SR.fsiDidAHashrWithLockWarning ar.resolvedPath fsiConsoleOutput.uprintnfnn "%s" format // Collect the overall resolutions let resolutions = [ - for (_, resolutions, _, _) in refs do + for _, resolutions, _, _ in refs do yield! resolutions ] // Add then to the config. - for (path, _, _, m) in refs do + for path, _, _, m in refs do tcConfigB.AddReferencedAssemblyByPath(m, path) let tcState = istate.tcState let tcEnv, asms = try - RequireReferences(ctok, tcImports, tcState.TcEnvFromImpls, dynamicCcuName (tcConfigB.fsiMultiAssemblyEmit), resolutions) + RequireReferences(ctok, tcImports, tcState.TcEnvFromImpls, dynamicCcuName tcConfigB.fsiMultiAssemblyEmit, resolutions) with _ -> - for (path, _, _, m) in refs do + for path, _, _, m in refs do tcConfigB.RemoveReferencedAssemblyByPath(m, path) reraise () @@ -2780,7 +2780,7 @@ type internal FsiDynamicCompiler // Send outputs via diagnostics if result.StdOut.Length > 0 || result.StdError.Length > 0 then for line in Array.append result.StdOut result.StdError do - errorR (Error(FSComp.SR.packageManagerError (line), m)) + errorR (Error(FSComp.SR.packageManagerError line, m)) //Write outputs in F# Interactive and compiler tcConfigB.packageManagerLines <- @@ -3031,7 +3031,7 @@ type internal FsiDynamicCompiler let emEnv0 = if tcConfigB.fsiMultiAssemblyEmit then let emEnv = - ILMultiInMemoryAssemblyEmitEnv(ilGlobals, resolveAssemblyRef, dynamicCcuName (tcConfigB.fsiMultiAssemblyEmit)) + ILMultiInMemoryAssemblyEmitEnv(ilGlobals, resolveAssemblyRef, dynamicCcuName tcConfigB.fsiMultiAssemblyEmit) MultipleInMemoryAssemblies emEnv else @@ -3047,7 +3047,7 @@ type internal FsiDynamicCompiler let emEnv = emEnv0 SingleRefEmitAssembly(cenv, emEnv) - let ccuName = dynamicCcuName (tcConfigB.fsiMultiAssemblyEmit) + let ccuName = dynamicCcuName tcConfigB.fsiMultiAssemblyEmit let tcEnv, openDecls0 = GetInitialTcEnv(ccuName, rangeStdin0, tcConfig, tcImports, tcGlobals) @@ -3297,7 +3297,7 @@ type internal MagicAssemblyResolution() = | None -> // Check dynamic assemblies by simple name match fsiDynamicCompiler.FindDynamicAssembly(simpleAssemName, false) with - | Some asm when not (tcConfigB.fsiMultiAssemblyEmit) -> asm + | Some asm when not tcConfigB.fsiMultiAssemblyEmit -> asm | _ -> // Otherwise continue @@ -3392,7 +3392,7 @@ type internal MagicAssemblyResolution() = | Some resolvedPath -> OkResult([], Choice1Of2 resolvedPath) | None -> - ErrorResult([], Failure(FSIstrings.SR.fsiFailedToResolveAssembly (simpleAssemName))) + ErrorResult([], Failure(FSIstrings.SR.fsiFailedToResolveAssembly simpleAssemName)) match overallSearchResult with | ErrorResult _ -> null @@ -3402,7 +3402,7 @@ type internal MagicAssemblyResolution() = match res with | Choice1Of2 assemblyName -> if simpleAssemName <> "Mono.Posix" && progress then - fsiConsoleOutput.uprintfn "%s" (FSIstrings.SR.fsiBindingSessionTo (assemblyName)) + fsiConsoleOutput.uprintfn "%s" (FSIstrings.SR.fsiBindingSessionTo assemblyName) if isRunningOnCoreClr then assemblyLoadFrom assemblyName @@ -3472,11 +3472,11 @@ type internal MagicAssemblyResolution() = args.Name )) - AppDomain.CurrentDomain.add_AssemblyResolve (resolveAssembly) + AppDomain.CurrentDomain.add_AssemblyResolve resolveAssembly { new IDisposable with member _.Dispose() = - AppDomain.CurrentDomain.remove_AssemblyResolve (resolveAssembly) + AppDomain.CurrentDomain.remove_AssemblyResolve resolveAssembly } //---------------------------------------------------------------------------- @@ -3682,7 +3682,7 @@ type FsiInteractionProcessor if FileSystem.DirectoryExistsShim(path) then tcConfigB.implicitIncludeDir <- path else - error (Error(FSIstrings.SR.fsiDirectoryDoesNotExist (path), m)) + error (Error(FSIstrings.SR.fsiDirectoryDoesNotExist path, m)) /// Parse one interaction. Called on the parser thread. let ParseInteraction diagnosticOptions (tokenizer: LexFilter.LexFilter) = @@ -3857,7 +3857,7 @@ type FsiInteractionProcessor PrintOptionInfo tcConfigB istate, Completed None #endif - | ParsedHashDirective(("clear"), [], _) -> + | ParsedHashDirective("clear", [], _) -> fsiOptions.ClearScreen() istate, Completed None @@ -3975,7 +3975,7 @@ type FsiInteractionProcessor let hashes = List.takeWhile isDefHash defs |> List.choose (function - | (SynModuleDecl.HashDirective(hash, _)) -> Some(hash) + | SynModuleDecl.HashDirective(hash, _) -> Some(hash) | _ -> None) let defsB = List.skipWhile isDefHash defs @@ -4086,8 +4086,8 @@ type FsiInteractionProcessor (istate, CtrlC) | :? TargetInvocationException as e when - (ControlledExecution.StripTargetInvocationException(e)).GetType().Name = "ThreadAbortException" - || (ControlledExecution.StripTargetInvocationException(e)).GetType().Name = "OperationCanceledException" + ControlledExecution.StripTargetInvocationException(e).GetType().Name = "ThreadAbortException" + || ControlledExecution.StripTargetInvocationException(e).GetType().Name = "OperationCanceledException" -> fsiInterruptController.ClearInterruptRequest() fsiInterruptController.InterruptAllowed <- InterruptIgnored @@ -4494,7 +4494,7 @@ let internal DriveFsiEventLoop fsi.EventLoopRun() with | :? TargetInvocationException as e when - (ControlledExecution.StripTargetInvocationException(e)).GetType().Name = "ThreadAbortException" + ControlledExecution.StripTargetInvocationException(e).GetType().Name = "ThreadAbortException" -> // If this TAE handler kicks it's almost certainly too late to save the // state of the process - the state of the message loop may have been corrupted @@ -4603,7 +4603,7 @@ type FsiEvaluationSession do InstallErrorLoggingOnThisThread diagnosticsLogger // FSI error logging on main thread. let updateBannerText () = - tcConfigB.productNameForBannerText <- FSIstrings.SR.fsiProductName (FSharpBannerVersion) + tcConfigB.productNameForBannerText <- FSIstrings.SR.fsiProductName FSharpBannerVersion do updateBannerText () // setting the correct banner so that 'fsi -?' display the right thing @@ -4633,7 +4633,7 @@ type FsiEvaluationSession try SetServerCodePages fsiOptions with e -> - warning (e) + warning e let restoreEncoding = if tcConfigB.utf8output && Console.OutputEncoding <> Encoding.UTF8 then @@ -5264,7 +5264,7 @@ type CompilerInputStream() = /// Feeds content into the stream. member _.Add(str: string) = - if (String.IsNullOrEmpty(str)) then + if String.IsNullOrEmpty(str) then () else diff --git a/src/Compiler/Interactive/fsihelp.fs b/src/Compiler/Interactive/fsihelp.fs index 8cffd66b1e1..c1629c76134 100644 --- a/src/Compiler/Interactive/fsihelp.fs +++ b/src/Compiler/Interactive/fsihelp.fs @@ -51,7 +51,7 @@ module Parser = if not this.Exceptions.IsEmpty then sb.AppendLine "\nExceptions:" |> ignore - for (exType, exDesc) in this.Exceptions do + for exType, exDesc in this.Exceptions do sb.AppendLine $"%s{exType}: %s{exDesc}" |> ignore if not this.Examples.IsEmpty then diff --git a/src/Compiler/Optimize/LowerSequences.fs b/src/Compiler/Optimize/LowerSequences.fs index df19323cb66..3b7b4a51181 100644 --- a/src/Compiler/Optimize/LowerSequences.fs +++ b/src/Compiler/Optimize/LowerSequences.fs @@ -662,7 +662,7 @@ let ConvertSequenceExprToObject g amap overallExpr = let dtree = TDSwitch( pcExpr, - [ mkCase((DecisionTreeTest.Const(Const.Int32 pcDone)), addResultTarget (Expr.Op (TOp.Goto doneDisposeLabel, [], [], m)) ) ], + [ mkCase(DecisionTreeTest.Const(Const.Int32 pcDone), addResultTarget (Expr.Op (TOp.Goto doneDisposeLabel, [], [], m)) ) ], Some (addResultTarget (mkUnit g m)), m) let pcIsEndStateComparison = mbuilder.Close(dtree, m, g.unit_ty) diff --git a/src/Compiler/Optimize/LowerStateMachines.fs b/src/Compiler/Optimize/LowerStateMachines.fs index f3c3b8d7755..90238e0dc3c 100644 --- a/src/Compiler/Optimize/LowerStateMachines.fs +++ b/src/Compiler/Optimize/LowerStateMachines.fs @@ -269,7 +269,7 @@ type LowerStateMachine(g: TcGlobals) = | Expr.Op (TOp.ILAsm ([ I_throw ], [_oldTy]), a, b, c), Some newTy -> let targetExpr2 = Expr.Op (TOp.ILAsm ([ I_throw ], [newTy]), a, b, c) Some targetExpr2 - | Expr.Sequential (DebugPoints((Expr.Op (TOp.ILCall ( _, _, _, _, _, _, _, ilMethodRef, _, _, _), _, _, _) as e1), rebuild1), Expr.Const (Const.Zero, m, _oldTy), a, c), Some newTy when ilMethodRef.Name = "Throw" -> + | Expr.Sequential (DebugPoints(Expr.Op (TOp.ILCall ( _, _, _, _, _, _, _, ilMethodRef, _, _, _), _, _, _) as e1, rebuild1), Expr.Const (Const.Zero, m, _oldTy), a, c), Some newTy when ilMethodRef.Name = "Throw" -> let targetExpr2 = Expr.Sequential (e1, rebuild1 (Expr.Const (Const.Zero, m, newTy)), a, c) Some targetExpr2 | _ -> diff --git a/src/Compiler/Optimize/Optimizer.fs b/src/Compiler/Optimize/Optimizer.fs index 59a4e69ffe9..d8f155d9234 100644 --- a/src/Compiler/Optimize/Optimizer.fs +++ b/src/Compiler/Optimize/Optimizer.fs @@ -702,7 +702,7 @@ let IsPartialExpr cenv env m x = | Expr.Let (TBind (_,expr,_), body, _, _) -> expr :: [body] |> List.exists isPartialExpression | Expr.LetRec (bindings, body, _, _) -> body :: (bindings |> List.map (fun (TBind (_,expr,_)) -> expr)) |> List.exists isPartialExpression | Expr.Sequential (expr1, expr2, _, _) -> [expr1; expr2] |> Seq.exists isPartialExpression - | Expr.Val (vr, _, _) when not vr.IsLocalRef -> ((GetInfoForVal cenv env m vr).ValExprInfo) |> IsPartialExprVal + | Expr.Val (vr, _, _) when not vr.IsLocalRef -> (GetInfoForVal cenv env m vr).ValExprInfo |> IsPartialExprVal | _ -> false isPartialExpression x @@ -1447,7 +1447,7 @@ let AbstractExprInfoByVars (boundVars: Val list, boundTyVars) ivalue = // Check for escape in lambda | CurriedLambdaValue (_, _, _, expr, _) | ConstExprValue(_, expr) when - (let fvs = freeInExpr (if isNil boundTyVars then (CollectLocalsWithStackGuard()) else CollectTyparsAndLocals) expr + (let fvs = freeInExpr (if isNil boundTyVars then CollectLocalsWithStackGuard() else CollectTyparsAndLocals) expr (not (isNil boundVars) && List.exists (Zset.memberOf fvs.FreeLocals) boundVars) || (not (isNil boundTyVars) && List.exists (Zset.memberOf fvs.FreeTyvars.FreeTypars) boundTyVars) || fvs.UsesMethodLocalConstructs) -> @@ -2515,7 +2515,7 @@ and MakeOptimizedSystemStringConcatCall cenv env m args = and optimizeArgs args accArgs = (args, accArgs) - ||> List.foldBack (optimizeArg) + ||> List.foldBack optimizeArg let args = optimizeArgs args [] diff --git a/src/Compiler/Service/FSharpCheckerResults.fs b/src/Compiler/Service/FSharpCheckerResults.fs index 7df88de24d3..41c2c4bcd50 100644 --- a/src/Compiler/Service/FSharpCheckerResults.fs +++ b/src/Compiler/Service/FSharpCheckerResults.fs @@ -797,7 +797,7 @@ type internal TypeCheckInfo let qual = quals |> Array.tryFind (fun (_, _, _, r) -> - ignore (r) // for breakpoint + ignore r // for breakpoint posEq exprRange.Start r.Start) qual, false @@ -3024,7 +3024,7 @@ module internal ParseAndCheckFile = | INTERP_STRING_BEGIN_PART _ | INTERP_STRING_PART _ as tok, _ -> let braceOffset = match tok with - | INTERP_STRING_BEGIN_PART(_, SynStringKind.TripleQuote, (LexerContinuation.Token(_, (_, _, dl, _, _) :: _))) -> + | INTERP_STRING_BEGIN_PART(_, SynStringKind.TripleQuote, LexerContinuation.Token(_, (_, _, dl, _, _) :: _)) -> dl - 1 | _ -> 0 diff --git a/src/Compiler/Service/FSharpProjectSnapshot.fs b/src/Compiler/Service/FSharpProjectSnapshot.fs index 6e50e643293..2183ca75e87 100644 --- a/src/Compiler/Service/FSharpProjectSnapshot.fs +++ b/src/Compiler/Service/FSharpProjectSnapshot.fs @@ -132,7 +132,7 @@ type FSharpFileSnapshot(FileName: string, Version: string, GetSource: unit -> Ta type internal FSharpFileSnapshotWithSource (FileName: string, SourceHash: ImmutableArray, Source: ISourceTextNew, IsLastCompiland: bool, IsExe: bool) = - let version = lazy (SourceHash.ToBuilder().ToArray()) + let version = lazy SourceHash.ToBuilder().ToArray() let stringVersion = lazy (version.Value |> BitConverter.ToString) member val Version = version.Value @@ -202,14 +202,14 @@ type internal ProjectSnapshotBase<'T when 'T :> IFileSnapshot> let noFileVersionsKey = lazy - ({ new ICacheKey<_, _> with - member _.GetLabel() = projectConfig.Label - member _.GetKey() = projectConfig.Identifier + { new ICacheKey<_, _> with + member _.GetLabel() = projectConfig.Label + member _.GetKey() = projectConfig.Identifier - member _.GetVersion() = - noFileVersionsHash.Value |> Md5Hasher.toString + member _.GetVersion() = + noFileVersionsHash.Value |> Md5Hasher.toString - }) + } let fullHash = lazy @@ -225,11 +225,11 @@ type internal ProjectSnapshotBase<'T when 'T :> IFileSnapshot> let fullKey = lazy - ({ new ICacheKey<_, _> with - member _.GetLabel() = projectConfig.Label - member _.GetKey() = projectConfig.Identifier - member _.GetVersion() = fullHash.Value |> Md5Hasher.toString - }) + { new ICacheKey<_, _> with + member _.GetLabel() = projectConfig.Label + member _.GetKey() = projectConfig.Identifier + member _.GetVersion() = fullHash.Value |> Md5Hasher.toString + } let addHash (file: 'T) hash = hash |> Md5Hasher.addString file.FileName |> Md5Hasher.addBytes file.Version diff --git a/src/Compiler/Service/FSharpWorkspaceState.fs b/src/Compiler/Service/FSharpWorkspaceState.fs index ff112a7977c..348e64b2259 100644 --- a/src/Compiler/Service/FSharpWorkspaceState.fs +++ b/src/Compiler/Service/FSharpWorkspaceState.fs @@ -150,7 +150,7 @@ module internal WorkspaceDependencyGraphExtensions = [] static member AddProjectWithoutFiles - (this: GraphBuilder<_, _, (ProjectConfig * FSharpProjectSnapshot seq), _>, computeProjectWithoutFiles) + (this: GraphBuilder<_, _, ProjectConfig * FSharpProjectSnapshot seq, _>, computeProjectWithoutFiles) = this.AddDependentNode( WorkspaceNodeKey.ProjectWithoutFiles this.State, @@ -168,13 +168,13 @@ module internal WorkspaceDependencyGraphExtensions = GraphBuilder( this.Graph, (Seq.append this.Ids ids), - (_.UnpackOneMany(WorkspaceNode.projectWithoutFiles, WorkspaceNode.sourceFile)), + _.UnpackOneMany(WorkspaceNode.projectWithoutFiles, WorkspaceNode.sourceFile), this.State ) [] static member AddProjectSnapshot - (this: GraphBuilder<_, _, (ProjectWithoutFiles * FSharpFileSnapshot seq), _>, computeProjectSnapshot) + (this: GraphBuilder<_, _, ProjectWithoutFiles * FSharpFileSnapshot seq, _>, computeProjectSnapshot) = this.AddDependentNode( @@ -334,27 +334,23 @@ type FSharpWorkspaceProjects internal (depGraph: IThreadSafeDependencyGraph<_, _ depGraph .AddReferencesOnDisk(projectConfig.ReferencesOnDisk) .AddProjectConfig(projectIdentifier, (fun refsOnDisk -> projectConfig.With(refsOnDisk |> Seq.toList))) - .AddProjectWithoutFiles( - (fun (projectConfig, referencedProjects) -> - - let referencedProjects = - referencedProjects - |> Seq.map (fun s -> - FSharpReferencedProjectSnapshot.FSharpReference( - s.OutputFileName - |> Option.defaultWith (fun () -> failwith "project doesn't have output filename"), - s + .AddProjectWithoutFiles(fun (projectConfig, referencedProjects) -> + + let referencedProjects = + referencedProjects + |> Seq.map (fun s -> + FSharpReferencedProjectSnapshot.FSharpReference( + s.OutputFileName + |> Option.defaultWith (fun () -> failwith "project doesn't have output filename"), + s )) - |> Seq.toList + |> Seq.toList - projectConfig, referencedProjects) - ) + projectConfig, referencedProjects) .AddSourceFiles(sourceFilePaths |> Seq.map (fun path -> path, createFileSnapshot path)) - .AddProjectSnapshot( - (fun ((projectConfig, referencedProjects), sourceFiles) -> - ProjectSnapshot(projectConfig, referencedProjects, sourceFiles |> Seq.toList) - |> FSharpProjectSnapshot) - ) + .AddProjectSnapshot(fun ((projectConfig, referencedProjects), sourceFiles) -> + ProjectSnapshot(projectConfig, referencedProjects, sourceFiles |> Seq.toList) + |> FSharpProjectSnapshot) // In case this is an update, we should check for any existing project references that are not contained in the incoming compiler args and remove them let existingReferences = depGraph.GetProjectReferencesOf projectIdentifier |> Set @@ -375,7 +371,7 @@ type FSharpWorkspaceProjects internal (depGraph: IThreadSafeDependencyGraph<_, _ for dependentProjectId in dependentProjectIds do depGraph.AddProjectReference(dependentProjectId, projectIdentifier) - this.Debug_DumpGraphOnEveryChange |> Option.iter (this.Debug_DumpMermaid) + this.Debug_DumpGraphOnEveryChange |> Option.iter this.Debug_DumpMermaid projectIdentifier) @@ -448,4 +444,4 @@ type FSharpWorkspaceProjects internal (depGraph: IThreadSafeDependencyGraph<_, _ depGraph.ReplaceSourceFiles(projectIdentifier, newFilesWithSnapshots) - this.Debug_DumpGraphOnEveryChange |> Option.iter (this.Debug_DumpMermaid)) + this.Debug_DumpGraphOnEveryChange |> Option.iter this.Debug_DumpMermaid) diff --git a/src/Compiler/Service/ItemKey.fs b/src/Compiler/Service/ItemKey.fs index 49cdda18940..a0680b689d6 100644 --- a/src/Compiler/Service/ItemKey.fs +++ b/src/Compiler/Service/ItemKey.fs @@ -578,8 +578,8 @@ and [] ItemKeyStoreBuilder(tcGlobals: TcGlobals) = // Items are flattened so multiples are not expected | Item.Types(_, _ :: _ :: _) -> () | Item.UnqualifiedType(_ :: _ :: _) -> () - | Item.MethodGroup(_, (_ :: _ :: _), _) -> () - | Item.CtorGroup(_, (_ :: _ :: _)) -> () + | Item.MethodGroup(_, _ :: _ :: _, _) -> () + | Item.CtorGroup(_, _ :: _ :: _) -> () | Item.ModuleOrNamespaces(_ :: _ :: _) -> () let postCount = b.Count diff --git a/src/Compiler/Service/QuickParse.fs b/src/Compiler/Service/QuickParse.fs index e7361ce1634..6a3e9a2b8b3 100644 --- a/src/Compiler/Service/QuickParse.fs +++ b/src/Compiler/Service/QuickParse.fs @@ -166,7 +166,7 @@ module QuickParse = let r = searchRight p let ident = lineStr.Substring(l, r - l + 1) - if ident.IndexOf('|') <> -1 && not (isValidActivePatternName (ident)) then + if ident.IndexOf('|') <> -1 && not (isValidActivePatternName ident) then None else let pos = r + MagicalAdjustmentConstant @@ -229,7 +229,7 @@ module QuickParse = let rec InLeadingIdentifier (pos, right, (prior, residue)) = let PushName () = - ((lineStr.Substring(pos + 1, right - pos - 1)) :: prior), residue + (lineStr.Substring(pos + 1, right - pos - 1) :: prior), residue if pos < 0 then PushName() @@ -242,10 +242,10 @@ module QuickParse = let rec InName (pos, startResidue, right) = let NameAndResidue () = - [ lineStr.Substring(pos + 1, startResidue - pos - 1) ], (lineStr.Substring(startResidue + 1, right - startResidue)) + [ lineStr.Substring(pos + 1, startResidue - pos - 1) ], lineStr.Substring(startResidue + 1, right - startResidue) if pos < 0 then - [ lineStr.Substring(pos + 1, startResidue - pos - 1) ], (lineStr.Substring(startResidue + 1, right - startResidue)) + [ lineStr.Substring(pos + 1, startResidue - pos - 1) ], lineStr.Substring(startResidue + 1, right - startResidue) elif IsIdentifierPartCharacter pos then InName(pos - 1, startResidue, right) elif IsDot pos then diff --git a/src/Compiler/Service/ServiceCompilerDiagnostics.fs b/src/Compiler/Service/ServiceCompilerDiagnostics.fs index 0380f456c65..345c4771601 100644 --- a/src/Compiler/Service/ServiceCompilerDiagnostics.fs +++ b/src/Compiler/Service/ServiceCompilerDiagnostics.fs @@ -16,7 +16,7 @@ module CompilerDiagnostics = let GetErrorMessage diagnosticKind = match diagnosticKind with | FSharpDiagnosticKind.AddIndexerDot -> FSComp.SR.addIndexerDot () - | FSharpDiagnosticKind.ReplaceWithSuggestion s -> FSComp.SR.replaceWithSuggestion (s) + | FSharpDiagnosticKind.ReplaceWithSuggestion s -> FSComp.SR.replaceWithSuggestion s | FSharpDiagnosticKind.RemoveIndexerDot -> FSComp.SR.tcIndexNotationDeprecated () |> snd let GetSuggestedNames (suggestionsF: FSharp.Compiler.DiagnosticsLogger.Suggestions) (unresolvedIdentifier: string) = diff --git a/src/Compiler/Service/ServiceNavigation.fs b/src/Compiler/Service/ServiceNavigation.fs index acd98980268..25708f87f5b 100755 --- a/src/Compiler/Service/ServiceNavigation.fs +++ b/src/Compiler/Service/ServiceNavigation.fs @@ -163,7 +163,7 @@ module NavigationImpl = let createMember (id: Ident, kind, baseGlyph, m, enclosingEntityKind, isAbstract, access) = let item = NavigationItem.Create(id.idText, kind, baseGlyph, m, m, false, enclosingEntityKind, isAbstract, access) - item, addItemName (id.idText) + item, addItemName id.idText // Process let-binding let processBinding isMember enclosingEntityKind isAbstract synBinding = @@ -384,10 +384,10 @@ module NavigationImpl = | SynModuleDecl.NestedModule(moduleInfo = SynComponentInfo(longId = lid; accessibility = access); decls = decls; range = m) -> // Find let bindings (for the right dropdown) - let nested = processNestedDeclarations (decls) + let nested = processNestedDeclarations decls let newBaseName = - (if (String.IsNullOrEmpty(baseName)) then + (if String.IsNullOrEmpty(baseName) then "" else baseName + ".") @@ -417,7 +417,7 @@ module NavigationImpl = let (SynModuleOrNamespace(id, _isRec, kind, decls, _, _, access, m, _)) = modul let baseName = if (not singleTopLevel) then textOfLid id else "" // Find let bindings (for the right dropdown) - let nested = processNestedDeclarations (decls) + let nested = processNestedDeclarations decls // Get nested modules and types (for the left dropdown) let other = processNavigationTopLevelDeclarations (baseName, decls) @@ -435,7 +435,7 @@ module NavigationImpl = let item = NavigationItem.Create(nm, kind, FSharpGlyph.Module, m, mBody, singleTopLevel, NavigationEntityKind.Module, false, access) - let decl = (item, addItemName (nm), nested) + let decl = (item, addItemName nm, nested) decl yield! other @@ -443,7 +443,7 @@ module NavigationImpl = let items = [| - for (d, idx, nested) in items do + for d, idx, nested in items do let nested = nested |> Array.ofList @@ -492,7 +492,7 @@ module NavigationImpl = let createMember (id: Ident, kind, baseGlyph, m, enclosingEntityKind, isAbstract, access) = let item = NavigationItem.Create(id.idText, kind, baseGlyph, m, m, false, enclosingEntityKind, isAbstract, access) - item, addItemName (id.idText) + item, addItemName id.idText let rec processExnRepr baseName nested inp = let (SynExceptionDefnRepr(_, SynUnionCase(ident = SynIdent(id, _); caseType = fldspec), _, _, access, m)) = inp @@ -609,7 +609,7 @@ module NavigationImpl = | SynModuleSigDecl.NestedModule(moduleInfo = SynComponentInfo(longId = lid; accessibility = access); moduleDecls = decls; range = m) -> // Find let bindings (for the right dropdown) - let nested = processNestedSigDeclarations (decls) + let nested = processNestedSigDeclarations decls let newBaseName = (if String.IsNullOrEmpty(baseName) then @@ -642,7 +642,7 @@ module NavigationImpl = let (SynModuleOrNamespaceSig(id, _isRec, kind, decls, _, _, access, m, _)) = modulSig let baseName = if (not singleTopLevel) then textOfLid id else "" // Find let bindings (for the right dropdown) - let nested = processNestedSigDeclarations (decls) + let nested = processNestedSigDeclarations decls // Get nested modules and types (for the left dropdown) let other = processNavigationTopLevelSigDeclarations (baseName, decls) @@ -665,7 +665,7 @@ module NavigationImpl = let items = [| - for (d, idx, nested) in items do + for d, idx, nested in items do let nested = nested |> Array.ofList diff --git a/src/Compiler/Service/ServiceParseTreeWalk.fs b/src/Compiler/Service/ServiceParseTreeWalk.fs index f280df1b237..a3af1b3ba08 100644 --- a/src/Compiler/Service/ServiceParseTreeWalk.fs +++ b/src/Compiler/Service/ServiceParseTreeWalk.fs @@ -309,7 +309,7 @@ module SyntaxTraversal = if posGt pos (fst r).Start then e <- r - snd (e) () + snd e () | [ x ] -> x () | _ -> #if DEBUG diff --git a/src/Compiler/Service/ServiceParsedInputOps.fs b/src/Compiler/Service/ServiceParsedInputOps.fs index 583c7c0f992..a209c500bbd 100644 --- a/src/Compiler/Service/ServiceParsedInputOps.fs +++ b/src/Compiler/Service/ServiceParsedInputOps.fs @@ -275,7 +275,7 @@ module ParsedInput = let rec collect expr acc = match expr with - | SynExpr.Sequential(expr1 = e1; expr2 = (SynExpr.Sequential _ as e2)) -> collect e2 (e1 :: acc) + | SynExpr.Sequential(expr1 = e1; expr2 = SynExpr.Sequential _ as e2) -> collect e2 (e1 :: acc) | SynExpr.Sequential(expr1 = e1; expr2 = e2) -> e2 :: e1 :: acc | _ -> acc diff --git a/src/Compiler/Service/ServiceStructure.fs b/src/Compiler/Service/ServiceStructure.fs index bcf0d8d2bc8..c507e82b00b 100644 --- a/src/Compiler/Service/ServiceStructure.fs +++ b/src/Compiler/Service/ServiceStructure.fs @@ -843,7 +843,7 @@ module Structure = | _ -> loop (lineNum, None, result) rest (lineNum + 1) let comments = - let (_, lastComment, comments) = loop (-1, None, []) (List.ofArray lines) 0 + let _, lastComment, comments = loop (-1, None, []) (List.ofArray lines) 0 match lastComment with | Some comment -> comment :: comments diff --git a/src/Compiler/Service/ServiceXmlDocParser.fs b/src/Compiler/Service/ServiceXmlDocParser.fs index e77ba1cbab9..f320606cb33 100644 --- a/src/Compiler/Service/ServiceXmlDocParser.fs +++ b/src/Compiler/Service/ServiceXmlDocParser.fs @@ -50,7 +50,7 @@ module XmlDocParsing = let parameters = [ for args in curriedArgs do - for (SynArgInfo(ident = ident)) in args do + for SynArgInfo(ident = ident) in args do match ident with | Some ident -> ident.idText | None -> () diff --git a/src/Compiler/Service/TransparentCompiler.fs b/src/Compiler/Service/TransparentCompiler.fs index 96c6738d001..fc049da736a 100644 --- a/src/Compiler/Service/TransparentCompiler.fs +++ b/src/Compiler/Service/TransparentCompiler.fs @@ -343,7 +343,7 @@ type internal CompilerCaches(cacheSizes: CacheSizes) = member val ParseFile = AsyncMemoize(keepStrongly = cs.ParseFileKeepStrongly, keepWeakly = cs.ParseFileKeepWeakly, name = "ParseFile") - : AsyncMemoize<(FSharpProjectIdentifier * string), (string * string * bool), FSharpParsedFile> + : AsyncMemoize member val ParseFileWithoutProject = AsyncMemoize( @@ -1282,7 +1282,7 @@ type internal TransparentCompiler else fileName) ) - |> Seq.map (snd >> (Seq.toList)) + |> Seq.map (snd >> Seq.toList) |> Seq.choose (function | [ idx1, _; idx2, _ ] -> max idx1 idx2 |> Some | _ -> None) @@ -1306,7 +1306,7 @@ type internal TransparentCompiler else fileName) ) - |> Seq.map (snd >> (Seq.toList)) + |> Seq.map (snd >> Seq.toList) |> Seq.choose (function | [ idx1, _; idx2, _ ] -> max idx1 idx2 |> Some | _ -> None) @@ -1624,7 +1624,7 @@ type internal TransparentCompiler let! result, tcInfo = ComputeTcLastFile bootstrapInfo snapshotWithSources - let (tcEnv, _topAttribs, checkedImplFileOpt, ccuSigForFile) = result + let tcEnv, _topAttribs, checkedImplFileOpt, ccuSigForFile = result let tcState = tcInfo.tcState @@ -1913,7 +1913,7 @@ type internal TransparentCompiler return assemblyDataResult with ex -> - errorR (exn ($"Error while computing assembly data for project {projectSnapshot.Label}: {ex}")) + errorR (exn $"Error while computing assembly data for project {projectSnapshot.Label}: {ex}") return ProjectAssemblyDataResult.Unavailable true } ) diff --git a/src/Compiler/Service/TransparentCompiler.fsi b/src/Compiler/Service/TransparentCompiler.fsi index 6792be3cdee..e01ad596eb3 100644 --- a/src/Compiler/Service/TransparentCompiler.fsi +++ b/src/Compiler/Service/TransparentCompiler.fsi @@ -95,7 +95,7 @@ type internal Extensions = [] static member Key: fileSnapshots: #IFileSnapshot list * ?extraKeyFlag: DependencyGraphType -> - ICacheKey<(DependencyGraphType option * byte array), string> + ICacheKey [] type CacheSizes = @@ -138,45 +138,45 @@ type internal CompilerCaches = new: cacheSizes: CacheSizes -> CompilerCaches - member AssemblyData: AsyncMemoize + member AssemblyData: AsyncMemoize - member BootstrapInfo: AsyncMemoize + member BootstrapInfo: AsyncMemoize member BootstrapInfoStatic: - AsyncMemoize)> + AsyncMemoize> member DependencyGraph: - AsyncMemoize<(DependencyGraphType option * byte array), string, (Graph * Graph)> + AsyncMemoize * Graph> - member FrameworkImports: AsyncMemoize + member FrameworkImports: AsyncMemoize - member ItemKeyStore: AsyncMemoize<(string * FSharpProjectIdentifier), string, ItemKeyStore option> + member ItemKeyStore: AsyncMemoize member ParseAndCheckAllFilesInProject: AsyncMemoizeDisabled member ParseAndCheckFileInProject: AsyncMemoize< - (string * FSharpProjectIdentifier), + string * FSharpProjectIdentifier, string * string, - (FSharpParseFileResults * FSharpCheckFileAnswer) + FSharpParseFileResults * FSharpCheckFileAnswer > member ParseAndCheckProject: AsyncMemoize - member ParseFile: AsyncMemoize<(FSharpProjectIdentifier * string), (string * string * bool), FSharpParsedFile> + member ParseFile: AsyncMemoize member ParseFileWithoutProject: AsyncMemoize member ProjectExtras: AsyncMemoizeDisabled member SemanticClassification: - AsyncMemoize<(string * FSharpProjectIdentifier), string, SemanticClassificationView option> + AsyncMemoize member CacheSizes: CacheSizes - member TcIntermediate: AsyncMemoize<(string * FSharpProjectIdentifier), (string * int), TcIntermediate> + member TcIntermediate: AsyncMemoize - member ScriptClosure: AsyncMemoize<(string * FSharpProjectIdentifier), string, LoadClosure> + member ScriptClosure: AsyncMemoize member TcLastFile: AsyncMemoizeDisabled diff --git a/src/Compiler/Service/service.fs b/src/Compiler/Service/service.fs index 6af298d1b7b..75d6c137087 100644 --- a/src/Compiler/Service/service.fs +++ b/src/Compiler/Service/service.fs @@ -24,7 +24,7 @@ open FSharp.Compiler.Text.Range type IsResultObsolete = IsResultObsolete of (unit -> bool) module CompileHelpers = - let mkCompilationDiagnosticsHandlers (flatErrors) = + let mkCompilationDiagnosticsHandlers flatErrors = let diagnostics = ResizeArray<_>() let diagnosticsLogger = diff --git a/src/Compiler/Symbols/FSharpDiagnostic.fs b/src/Compiler/Symbols/FSharpDiagnostic.fs index cafaf1c788b..24ea614cc16 100644 --- a/src/Compiler/Symbols/FSharpDiagnostic.fs +++ b/src/Compiler/Symbols/FSharpDiagnostic.fs @@ -300,7 +300,8 @@ type DiagnosticsScope(flatErrors: bool) = | None -> err "" /// A diagnostics logger that capture diagnostics, filtering them according to warning levels etc. -type internal CompilationDiagnosticLogger(debugName: string, options: FSharpDiagnosticOptions, ?preprocess: (PhasedDiagnostic -> PhasedDiagnostic)) = +type internal CompilationDiagnosticLogger(debugName: string, options: FSharpDiagnosticOptions, ?preprocess: + PhasedDiagnostic -> PhasedDiagnostic) = inherit DiagnosticsLogger("CompilationDiagnosticLogger("+debugName+")") let mutable errorCount = 0 diff --git a/src/Compiler/Symbols/SymbolHelpers.fs b/src/Compiler/Symbols/SymbolHelpers.fs index 75275eb1582..fed644eeb61 100644 --- a/src/Compiler/Symbols/SymbolHelpers.fs +++ b/src/Compiler/Symbols/SymbolHelpers.fs @@ -374,7 +374,7 @@ module internal SymbolHelpers = match item with | Item.Trait _ -> true | Item.Types(_, _ :: _) -> true - | Item.ILField(_) -> true + | Item.ILField _ -> true | Item.RecdField _ -> true | Item.SetterArg _ -> true | Item.TypeVar _ -> true @@ -808,7 +808,7 @@ module internal SymbolHelpers = let typeString = minfo.DeclaringTyconRef |> ticksAndArgCountTextOfTyconRef let paramString = let nGenericParams = minfo.RawMetadata.GenericParams.Length - if nGenericParams > 0 then "``"+(nGenericParams.ToString()) else "" + if nGenericParams > 0 then "``"+nGenericParams.ToString() else "" sprintf "%s.%s%s" typeString minfo.RawMetadata.Name paramString |> Some | MethInfoWithModifiedReturnType(mi,_) -> getKeywordForMethInfo mi diff --git a/src/Compiler/Symbols/Symbols.fs b/src/Compiler/Symbols/Symbols.fs index e43166ddf08..37f0d206fd3 100644 --- a/src/Compiler/Symbols/Symbols.fs +++ b/src/Compiler/Symbols/Symbols.fs @@ -1657,7 +1657,7 @@ type FSharpMemberOrFunctionOrValue(cenv, d:FSharpMemberOrValData, item) = let checkIsResolved() = if isUnresolved() then - let v = (fsharpInfo()).Value + let v = fsharpInfo().Value let nm = (match v with VRefNonLocal n -> n.ItemKey.PartialKey.LogicalName | _ -> "") invalidOp (sprintf "The value or member '%s' does not exist or is in an unresolved assembly." nm) diff --git a/src/Compiler/SyntaxTree/LexFilter.fs b/src/Compiler/SyntaxTree/LexFilter.fs index abb14ce6b70..ac068f3acd0 100644 --- a/src/Compiler/SyntaxTree/LexFilter.fs +++ b/src/Compiler/SyntaxTree/LexFilter.fs @@ -590,7 +590,7 @@ type PositionWithColumn = type LexFilterImpl ( indentationSyntaxStatus: IndentationAwareSyntaxStatus, compilingFSharpCore, - lexer: (Lexbuf -> token), + lexer: Lexbuf -> token, lexbuf: Lexbuf, debug: bool ) = @@ -718,7 +718,7 @@ type LexFilterImpl ( delayToken initialLookaheadTokenTup initialized <- true - offsideStack <- (CtxtSeqBlock(FirstInSeqBlock, startPosOfTokenTup initialLookaheadTokenTup, NoAddBlockEnd)) :: offsideStack + offsideStack <- CtxtSeqBlock(FirstInSeqBlock, startPosOfTokenTup initialLookaheadTokenTup, NoAddBlockEnd) :: offsideStack initialLookaheadTokenTup let reportDiagnostic reportF (s: TokenTup) msg = @@ -792,7 +792,7 @@ type LexFilterImpl ( // Otherwise the rule of 'match ... with' limited by 'match' (given RelaxWhitespace2) // will consider the CtxtMatch as the limiting context instead of allowing undentation until the parenthesis // Test here: Tests/FSharp.Compiler.ComponentTests/Conformance/LexicalFiltering/Basic/OffsideExceptions.fs, RelaxWhitespace2_AllowedBefore11 - | _, (CtxtMatchClauses _ as ctxt1) :: (CtxtMatch _) :: CtxtSeqBlock _ :: (CtxtParen ((BEGIN | LPAREN), _) as ctxt2) :: _ when relaxWhitespace2 + | _, (CtxtMatchClauses _ as ctxt1) :: CtxtMatch _ :: CtxtSeqBlock _ :: (CtxtParen ((BEGIN | LPAREN), _) as ctxt2) :: _ when relaxWhitespace2 -> if ctxt1.StartCol <= ctxt2.StartCol then PositionWithColumn(ctxt1.StartPos, ctxt1.StartCol) else PositionWithColumn(ctxt2.StartPos, ctxt2.StartCol) @@ -811,11 +811,11 @@ type LexFilterImpl ( -> undentationLimit false rest // 'try ... with' limited by 'try' - | _, (CtxtMatchClauses _ :: (CtxtTry _ as limitCtxt) :: _rest) + | _, CtxtMatchClauses _ :: (CtxtTry _ as limitCtxt) :: _rest -> PositionWithColumn(limitCtxt.StartPos, limitCtxt.StartCol) // 'match ... with' limited by 'match' (given RelaxWhitespace2) - | _, (CtxtMatchClauses _ :: (CtxtMatch _ as limitCtxt) :: _rest) when relaxWhitespace2 + | _, CtxtMatchClauses _ :: (CtxtMatch _ as limitCtxt) :: _rest when relaxWhitespace2 -> PositionWithColumn(limitCtxt.StartPos, limitCtxt.StartCol) // 'fun ->' places no limit until we hit a CtxtLetDecl etc... (Recursive) @@ -1180,7 +1180,7 @@ type LexFilterImpl ( let res = scanAhead 0 // Put the tokens back on and smash them up if needed - for (tokenTup, smash) in stack do + for tokenTup, smash in stack do if smash then match tokenTup.Token with | INFIX_COMPARE_OP " @@ -1584,7 +1584,7 @@ type LexFilterImpl ( | _ :: [] -> true // anything else is a non-namespace/module | _ -> false - while not offsideStack.IsEmpty && (not(nextOuterMostInterestingContextIsNamespaceOrModule offsideStack)) && + while not offsideStack.IsEmpty && not(nextOuterMostInterestingContextIsNamespaceOrModule offsideStack) && (match offsideStack.Head with // open-parens of sorts | CtxtParen(TokenLExprParen, _) -> true @@ -1686,7 +1686,7 @@ type LexFilterImpl ( hwTokenFetch useBlockRule // Balancing rule. Encountering a ')' or '}' balances with a '(' or '{', even if not offside - | ((TokenRExprParen | INTERP_STRING_END _ | INTERP_STRING_PART _) as t2), (CtxtParen (t1, _) :: _) + | TokenRExprParen | INTERP_STRING_END _ | INTERP_STRING_PART _ as t2, CtxtParen (t1, _) :: _ when parenTokensBalance t1 t2 -> if debug then dprintf "RPAREN/RBRACE/BAR_RBRACE/RBRACK/BAR_RBRACK/RQUOTE/END at %a terminates CtxtParen()\n" outputPos tokenStartPos popCtxt() @@ -2081,7 +2081,7 @@ type LexFilterImpl ( // else ... // .... // - | _, CtxtElse (offsidePos) :: _ when isSemiSemi || (if relaxWhitespace2OffsideRule then tokenStartCol + 1 else tokenStartCol) <= offsidePos.Column -> + | _, CtxtElse offsidePos :: _ when isSemiSemi || (if relaxWhitespace2OffsideRule then tokenStartCol + 1 else tokenStartCol) <= offsidePos.Column -> if debug then dprintf "offside from CtxtElse, popping\n" popCtxt() reprocess() @@ -2338,7 +2338,7 @@ type LexFilterImpl ( | WITH, (CtxtTry _ | CtxtMatch _) :: _ -> let lookaheadTokenTup = peekNextTokenTup() let lookaheadTokenStartPos = startPosOfTokenTup lookaheadTokenTup - let leadingBar = match (peekNextToken()) with BAR -> true | _ -> false + let leadingBar = match peekNextToken() with BAR -> true | _ -> false if debug then dprintf "WITH, pushing CtxtMatchClauses, lookaheadTokenStartPos = %a, tokenStartPos = %a\n" outputPos lookaheadTokenStartPos outputPos tokenStartPos tryPushCtxt strictIndentation false lookaheadTokenTup (CtxtMatchClauses(leadingBar, lookaheadTokenStartPos)) |> ignore @@ -2460,7 +2460,7 @@ type LexFilterImpl ( | FUNCTION, _ -> let lookaheadTokenTup = peekNextTokenTup() let lookaheadTokenStartPos = startPosOfTokenTup lookaheadTokenTup - let leadingBar = match (peekNextToken()) with BAR -> true | _ -> false + let leadingBar = match peekNextToken() with BAR -> true | _ -> false pushCtxt tokenTup (CtxtFunction tokenStartPos) pushCtxt lookaheadTokenTup (CtxtMatchClauses(leadingBar, lookaheadTokenStartPos)) returnToken tokenLexbufState OFUNCTION diff --git a/src/Compiler/SyntaxTree/LexHelpers.fs b/src/Compiler/SyntaxTree/LexHelpers.fs index c67aa134f84..360e683d2b7 100644 --- a/src/Compiler/SyntaxTree/LexHelpers.fs +++ b/src/Compiler/SyntaxTree/LexHelpers.fs @@ -451,7 +451,7 @@ module Keywords = | true, v -> match v with | RESERVED -> - warning (ReservedKeyword(FSComp.SR.lexhlpIdentifierReserved (s), lexbuf.LexemeRange)) + warning (ReservedKeyword(FSComp.SR.lexhlpIdentifierReserved s, lexbuf.LexemeRange)) IdentifierToken args lexbuf s | _ -> match s with @@ -462,7 +462,7 @@ module Keywords = | "lsr" | "asr" -> if lexbuf.SupportsFeature LanguageFeature.MLCompatRevisions then - mlCompatWarning (FSComp.SR.mlCompatKeyword (s)) lexbuf.LexemeRange + mlCompatWarning (FSComp.SR.mlCompatKeyword s) lexbuf.LexemeRange | _ -> () v diff --git a/src/Compiler/SyntaxTree/ParseHelpers.fs b/src/Compiler/SyntaxTree/ParseHelpers.fs index dcf905f7102..47c33e57bcd 100644 --- a/src/Compiler/SyntaxTree/ParseHelpers.fs +++ b/src/Compiler/SyntaxTree/ParseHelpers.fs @@ -654,7 +654,7 @@ let adjustHatPrefixToTyparLookup mFull rightExpr = | SynExpr.LongIdent(false, SynLongIdent([ typarIdent ], _, _), None, _) -> let typar = SynTypar(typarIdent, TyparStaticReq.HeadType, false) SynExpr.Typar(typar, mFull) - | SynExpr.LongIdent(false, SynLongIdent((typarIdent :: items), (dotm :: dots), (_ :: itemTrivias)), None, _) -> + | SynExpr.LongIdent(false, SynLongIdent(typarIdent :: items, dotm :: dots, _ :: itemTrivias), None, _) -> let typar = SynTypar(typarIdent, TyparStaticReq.HeadType, false) let lookup = SynLongIdent(items, dots, itemTrivias) SynExpr.DotGet(SynExpr.Typar(typar, mFull), dotm, lookup, mFull) diff --git a/src/Compiler/SyntaxTree/PrettyNaming.fs b/src/Compiler/SyntaxTree/PrettyNaming.fs index b0ef32edaf0..815c5d65903 100755 --- a/src/Compiler/SyntaxTree/PrettyNaming.fs +++ b/src/Compiler/SyntaxTree/PrettyNaming.fs @@ -1096,7 +1096,7 @@ module CustomOperations = let unassignedTyparName = "?" let FormatAndOtherOverloadsString remainingOverloads = - FSComp.SR.typeInfoOtherOverloads (remainingOverloads) + FSComp.SR.typeInfoOtherOverloads remainingOverloads let GetLongNameFromString x = SplitNamesForILPath x diff --git a/src/Compiler/SyntaxTree/SyntaxTreeOps.fs b/src/Compiler/SyntaxTree/SyntaxTreeOps.fs index aca54b53f04..29b3b6a1ff6 100644 --- a/src/Compiler/SyntaxTree/SyntaxTreeOps.fs +++ b/src/Compiler/SyntaxTree/SyntaxTreeOps.fs @@ -89,7 +89,7 @@ let rec pushUnaryArg expr arg = x1, m1 ) - | SynExpr.App(ExprAtomicFlag.Atomic, infix, (SynExpr.App(_) as innerApp), x1, m1) -> + | SynExpr.App(ExprAtomicFlag.Atomic, infix, (SynExpr.App _ as innerApp), x1, m1) -> SynExpr.App(ExprAtomicFlag.Atomic, infix, (pushUnaryArg innerApp arg), x1, m1) | SynExpr.App(ExprAtomicFlag.Atomic, infix, SynExpr.DotGet(synExpr, rangeOfDot, synLongIdent, range), x1, m1) -> SynExpr.App(ExprAtomicFlag.Atomic, infix, SynExpr.DotGet((pushUnaryArg synExpr arg), rangeOfDot, synLongIdent, range), x1, m1) @@ -447,7 +447,7 @@ let mkSynOperator (opm: range) (oper: string) = && ((opm.EndColumn - opm.StartColumn) = (oper.Length - 1)) then // PREFIX_OP token where the ~ was actually absent - IdentTrivia.OriginalNotation(string (oper.[1..])) + IdentTrivia.OriginalNotation(string oper.[1..]) else IdentTrivia.OriginalNotation oper @@ -1065,11 +1065,11 @@ let parsedHashDirectiveStringArguments (input: ParsedHashDirectiveArgument list) (function | ParsedHashDirectiveArgument.String(s, _, _) -> Some s | ParsedHashDirectiveArgument.Int32(n, m) -> - errorR (Error(FSComp.SR.featureParsedHashDirectiveUnexpectedInteger (n), m)) + errorR (Error(FSComp.SR.featureParsedHashDirectiveUnexpectedInteger n, m)) None | ParsedHashDirectiveArgument.SourceIdentifier(s, v, m) -> Some(applyLineDirectivesToSourceIdentifier s v m) | ParsedHashDirectiveArgument.Ident(ident, m) -> - errorR (Error(FSComp.SR.featureParsedHashDirectiveUnexpectedIdentifier (ident.idText), m)) + errorR (Error(FSComp.SR.featureParsedHashDirectiveUnexpectedIdentifier ident.idText, m)) None | ParsedHashDirectiveArgument.LongIdent(ident, m) -> errorR (Error(FSComp.SR.featureParsedHashDirectiveUnexpectedIdentifier (longIdentToString ident), m)) diff --git a/src/Compiler/SyntaxTree/XmlDoc.fs b/src/Compiler/SyntaxTree/XmlDoc.fs index c4ae54822c0..017298fa3a0 100644 --- a/src/Compiler/SyntaxTree/XmlDoc.fs +++ b/src/Compiler/SyntaxTree/XmlDoc.fs @@ -85,7 +85,7 @@ type XmlDoc(unprocessedLines: string[], range: range) = let nm = attr.Value if not (paramNames |> List.contains nm) then - warning (Error(FSComp.SR.xmlDocInvalidParameterName (nm), doc.Range)) + warning (Error(FSComp.SR.xmlDocInvalidParameterName nm, doc.Range)) let paramsWithDocs = [ @@ -99,12 +99,12 @@ type XmlDoc(unprocessedLines: string[], range: range) = for p in paramNames do if not (paramsWithDocs |> List.contains p) then - warning (Error(FSComp.SR.xmlDocMissingParameter (p), doc.Range)) + warning (Error(FSComp.SR.xmlDocMissingParameter p, doc.Range)) let duplicates = paramsWithDocs |> List.duplicates for d in duplicates do - warning (Error(FSComp.SR.xmlDocDuplicateParameter (d), doc.Range)) + warning (Error(FSComp.SR.xmlDocDuplicateParameter d, doc.Range)) for pref in xml.Descendants(XName.op_Implicit "paramref") do match pref.Attribute(!!(XName.op_Implicit "name")) with @@ -113,10 +113,10 @@ type XmlDoc(unprocessedLines: string[], range: range) = let nm = attr.Value if not (paramNames |> List.contains nm) then - warning (Error(FSComp.SR.xmlDocInvalidParameterName (nm), doc.Range)) + warning (Error(FSComp.SR.xmlDocInvalidParameterName nm, doc.Range)) with e -> - warning (Error(FSComp.SR.xmlDocBadlyFormed (e.Message), doc.Range)) + warning (Error(FSComp.SR.xmlDocBadlyFormed e.Message, doc.Range)) // Discriminated unions can't contain statics, so we use a separate type and XmlDocStatics() = diff --git a/src/Compiler/TypedTree/TcGlobals.fs b/src/Compiler/TypedTree/TcGlobals.fs index f9dcf0ad7b2..d00e6009231 100644 --- a/src/Compiler/TypedTree/TcGlobals.fs +++ b/src/Compiler/TypedTree/TcGlobals.fs @@ -1116,7 +1116,7 @@ type TcGlobals( member _.tryRemoveEmbeddedILTypeDefs () = [ for key in embeddedILTypeDefs.Keys.OrderBy id do - match (embeddedILTypeDefs.TryRemove(key)) with + match embeddedILTypeDefs.TryRemove(key) with | true, ilTypeDef -> yield ilTypeDef | false, _ -> () ] diff --git a/src/Compiler/TypedTree/TcGlobals.fsi b/src/Compiler/TypedTree/TcGlobals.fsi index a1d772e8438..27cbdb17748 100644 --- a/src/Compiler/TypedTree/TcGlobals.fsi +++ b/src/Compiler/TypedTree/TcGlobals.fsi @@ -22,7 +22,7 @@ type internal IntrinsicValRef = override ToString: unit -> string /// For debugging - [ (0))>] + [ 0)>] member DebugText: string member Name: string @@ -92,7 +92,7 @@ type internal BuiltinAttribInfo = override ToString: unit -> string /// For debugging - [ (0))>] + [ 0)>] member DebugText: string member TyconRef: TypedTree.TyconRef @@ -828,7 +828,7 @@ type internal TcGlobals = member knownFSharpCoreModules: System.Collections.Generic.IDictionary member knownIntrinsics: - System.Collections.Concurrent.ConcurrentDictionary<(string * string option * string * int), TypedTree.ValRef> + System.Collections.Concurrent.ConcurrentDictionary member knownWithNull: TypedTree.Nullness diff --git a/src/Compiler/TypedTree/TypeProviders.fs b/src/Compiler/TypedTree/TypeProviders.fs index 196e5d35adb..e20d683a121 100644 --- a/src/Compiler/TypedTree/TypeProviders.fs +++ b/src/Compiler/TypedTree/TypeProviders.fs @@ -22,7 +22,7 @@ open FSharp.Compiler.Text open FSharp.Compiler.Text.Range type TypeProviderDesignation = TypeProviderDesignation of string -type 'a ProvidedArray= ('a[]) MaybeNull +type 'a ProvidedArray= 'a[] MaybeNull module ProvidedArray = let map f (arr:_ ProvidedArray) : _ ProvidedArray = match arr with @@ -220,7 +220,8 @@ let TryTypeMemberArray (st: Tainted<_>, fullName, memberName, m, f) = [||] /// Try to access a member on a provided type, catching and reporting errors and checking the result is non-null, -let TryTypeMemberNonNull<'T, 'U when 'U : not null and 'U : not struct>(st: Tainted<'T>, fullName, memberName, m, recover: 'U, (f: 'T -> 'U | null)) : Tainted<'U> = +let TryTypeMemberNonNull<'T, 'U when 'U : not null and 'U : not struct>(st: Tainted<'T>, fullName, memberName, m, recover: 'U, + f: 'T -> 'U | null) : Tainted<'U> = match TryTypeMember<'T, 'U | null>(st, fullName, memberName, m, withNull recover, f) with | Tainted.Null -> errorR(Error(FSComp.SR.etUnexpectedNullFromProvidedTypeMember(fullName, memberName), m)) @@ -636,7 +637,7 @@ type ProvidedAssembly (x: Assembly) = member _.GetManifestModuleContents(provider: ITypeProvider) = provider.GetGeneratedAssemblyContents x - static member Create (x: Assembly MaybeNull) : ProvidedAssembly MaybeNull = match x with null -> null | t -> ProvidedAssembly (t) + static member Create (x: Assembly MaybeNull) : ProvidedAssembly MaybeNull = match x with null -> null | t -> ProvidedAssembly t member _.Handle = x diff --git a/src/Compiler/TypedTree/TypeProviders.fsi b/src/Compiler/TypedTree/TypeProviders.fsi index c29f091be78..a6ec5807198 100755 --- a/src/Compiler/TypedTree/TypeProviders.fsi +++ b/src/Compiler/TypedTree/TypeProviders.fsi @@ -15,7 +15,7 @@ open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.Text type TypeProviderDesignation = TypeProviderDesignation of string -type 'a ProvidedArray = ('a[]) MaybeNull +type 'a ProvidedArray = 'a[] MaybeNull /// Raised when a type provider has thrown an exception. exception ProvidedTypeResolution of range * exn diff --git a/src/Compiler/TypedTree/TypedTree.fs b/src/Compiler/TypedTree/TypedTree.fs index f5191136852..a8937babc93 100644 --- a/src/Compiler/TypedTree/TypedTree.fs +++ b/src/Compiler/TypedTree/TypedTree.fs @@ -2227,7 +2227,7 @@ type Accessibility = override x.ToString() = match x with - | TAccess (paths) -> + | TAccess paths -> let mangledTextOfCompPath (CompPath(scoref, _, path)) = getNameOfScopeRef scoref + "/" + textOfPath (List.map fst path) let scopename = if x.IsPublic then "public" @@ -3694,7 +3694,7 @@ type EntityRef = /// or comes from another F# assembly then it does not (because the documentation will get read from /// an XML file). member x.XmlDoc = - if not (x.Deref.XmlDoc.IsEmpty) then + if not x.Deref.XmlDoc.IsEmpty then x.Deref.XmlDoc else x.Deref.entity_opt_data @@ -6042,7 +6042,7 @@ type Construct() = let lazyBaseTy = LazyWithContext.Create ((fun (m, objTy) -> - let baseSystemTy = st.PApplyOption((fun st -> match st.BaseType with null -> None | ty -> Some (ty)), m) + let baseSystemTy = st.PApplyOption((fun st -> match st.BaseType with null -> None | ty -> Some ty), m) match baseSystemTy with | None -> objTy | Some t -> importProvidedType t), diff --git a/src/Compiler/TypedTree/TypedTree.fsi b/src/Compiler/TypedTree/TypedTree.fsi index 2ca4a7f5c68..b47b0ebcdd3 100644 --- a/src/Compiler/TypedTree/TypedTree.fsi +++ b/src/Compiler/TypedTree/TypedTree.fsi @@ -966,7 +966,7 @@ type TProvidedTypeInfo = /// The base type of the type. We use it to compute the compiled representation of the type for erased types. /// Reading is delayed, since it does an import on the underlying type - LazyBaseType: LazyWithContext + LazyBaseType: LazyWithContext /// A flag read eagerly from the provided type type used to compute basic properties of the type definition. IsClass: bool diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 0bfc1e35bb1..15debb7621a 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -3080,8 +3080,8 @@ module PrettyTypes = x let PrettifyInst g x = - PrettifyThings g - (foldTyparInst) + PrettifyThings g + foldTyparInst (fun f -> mapTyparInst g f) x @@ -3204,7 +3204,7 @@ type DisplayEnv = member x.SetOpenPaths paths = { x with - openTopPathsSorted = (InterruptibleLazy(fun _ -> paths |> List.sortWith (fun p1 p2 -> -(compare p1 p2)))) + openTopPathsSorted = InterruptibleLazy(fun _ -> paths |> List.sortWith (fun p1 p2 -> -(compare p1 p2))) openTopPathsRaw = paths } @@ -4363,7 +4363,7 @@ module DebugPrint = (wordL(tagText "slot") --- (wordL (tagText nm)) ^^ wordL(tagText "@") ^^ typeL ty) -- (wordL(tagText "LAM") --- spaceListL (List.map typarL tps1) ^^ rightL(tagText ".")) --- (wordL(tagText "LAM") --- spaceListL (List.map typarL tps2) ^^ rightL(tagText ".")) --- - (commaListL (List.map (List.map tslotparamL >> tupleL) pms)) ^^ (wordL(tagText "-> ")) --- (typeL retTy) + (commaListL (List.map (List.map tslotparamL >> tupleL) pms)) ^^ wordL(tagText "-> ") --- (typeL retTy) #else ignore slotsig wordL(tagText "slotsig") @@ -4664,8 +4664,8 @@ module DebugPrint = | Expr.Op (TOp.TraitCall _, _tyargs, _args, _) -> wordL(tagText "traitcall...") | Expr.Op (TOp.ExnFieldGet _, _tyargs, _args, _) -> wordL(tagText "TOp.ExnFieldGet...") | Expr.Op (TOp.ExnFieldSet _, _tyargs, _args, _) -> wordL(tagText "TOp.ExnFieldSet...") - | Expr.Op (TOp.TryFinally _, _tyargs, args, _) -> wordL(tagText ("unexpected-try-finally")) ---- aboveListL (List.map atomL args) - | Expr.Op (TOp.TryWith _, _tyargs, args, _) -> wordL(tagText ("unexpected-try-with")) ---- aboveListL (List.map atomL args) + | Expr.Op (TOp.TryFinally _, _tyargs, args, _) -> wordL(tagText "unexpected-try-finally") ---- aboveListL (List.map atomL args) + | Expr.Op (TOp.TryWith _, _tyargs, args, _) -> wordL(tagText "unexpected-try-with") ---- aboveListL (List.map atomL args) | Expr.Op (TOp.Goto l, _tys, args, _) -> wordL(tagText ("Expr.Goto " + string l)) ^^ bracketL (commaListL (List.map atomL args)) | Expr.Op (TOp.Label l, _tys, args, _) -> wordL(tagText ("Expr.Label " + string l)) ^^ bracketL (commaListL (List.map atomL args)) | Expr.Op (_, _tys, args, _) -> wordL(tagText "Expr.Op ...") ^^ bracketL (commaListL (List.map atomL args)) @@ -4689,7 +4689,7 @@ module DebugPrint = | Expr.StaticOptimization (_tcs, csx, x, _) -> (wordL(tagText "opt") @@- (exprL x)) @@-- - (wordL(tagText "|") ^^ exprL csx --- (wordL(tagText "when...") )) + (wordL(tagText "|") ^^ exprL csx --- wordL(tagText "when...")) // For tracking ranges through expr rewrites if layoutRanges then @@ -4712,7 +4712,7 @@ module DebugPrint = let bind = wordL(tagText "let") ^^ bindingL bind (bind @@ decisionTreeL body) | TDSuccess (args, n) -> - wordL(tagText "Success") ^^ leftL(tagText "T") ^^ intL n ^^ tupleL (args |> List.map (exprL)) + wordL(tagText "Success") ^^ leftL(tagText "T") ^^ intL n ^^ tupleL (args |> List.map exprL) | TDSwitch (test, dcases, dflt, _) -> (wordL(tagText "Switch") --- exprL test) @@-- (aboveListL (List.map dcaseL dcases) @@ @@ -4823,7 +4823,7 @@ module DebugPrint = (header @@-- body) @@ footer let implFileL (CheckedImplFile (signature=implFileTy; contents=implFileContents)) = - aboveListL [(wordL(tagText "top implementation ")) @@-- mexprL implFileTy implFileContents] + aboveListL [ wordL(tagText "top implementation ") @@-- mexprL implFileTy implFileContents] let implFilesL implFiles = aboveListL (List.map implFileL implFiles) @@ -5226,7 +5226,7 @@ let (|LinearMatchExpr|_|) expr = | _ -> ValueNone let rebuildLinearMatchExpr (sp, m, dtree, tg1, e2, m2, ty) = - primMkMatch (sp, m, dtree, [|tg1;(TTarget([], e2, None))|], m2, ty) + primMkMatch (sp, m, dtree, [|tg1;TTarget([], e2, None) |], m2, ty) /// Detect a subset of 'Expr.Op' expressions we process in a linear way (i.e. using tailcalls, rather than /// unbounded stack). Only covers Cons(args,Cons(args,Cons(args,Cons(args,...._)))). @@ -8249,7 +8249,7 @@ let tref_SourceConstructFlags (g: TcGlobals) = mkILTyRef (g.fslibCcu.ILScopeRef, let mkCompilationMappingAttrPrim (g: TcGlobals) k nums = mkILCustomAttribute (tref_CompilationMappingAttr g, ((mkILNonGenericValueTy (tref_SourceConstructFlags g)) :: (nums |> List.map (fun _ -> g.ilg.typ_Int32))), - ((k :: nums) |> List.map (ILAttribElem.Int32)), + ((k :: nums) |> List.map ILAttribElem.Int32), []) let mkCompilationMappingAttr g kind = mkCompilationMappingAttrPrim g kind [] @@ -8260,7 +8260,7 @@ let mkCompilationMappingAttrWithVariantNumAndSeqNum g kind varNum seqNum = mkCom let mkCompilationArgumentCountsAttr (g: TcGlobals) nums = mkILCustomAttribute (tref_CompilationArgumentCountsAttr g, [ mkILArr1DTy g.ilg.typ_Int32 ], - [ILAttribElem.Array (g.ilg.typ_Int32, List.map (ILAttribElem.Int32) nums)], + [ILAttribElem.Array (g.ilg.typ_Int32, List.map ILAttribElem.Int32 nums)], []) let mkCompilationSourceNameAttr (g: TcGlobals) n = @@ -8482,7 +8482,7 @@ let (|NewDelegateExpr|_|) g expr = [] let (|DelegateInvokeExpr|_|) g expr = match expr with - | Expr.App ((Expr.Val (invokeRef, _, _)) as delInvokeRef, delInvokeTy, tyargs, [delExpr;delInvokeArg], m) + | Expr.App (Expr.Val (invokeRef, _, _) as delInvokeRef, delInvokeTy, tyargs, [delExpr;delInvokeArg], m) when invokeRef.LogicalName = "Invoke" && isFSharpDelegateTy g (tyOfExpr g delExpr) -> ValueSome(delInvokeRef, delInvokeTy, tyargs, delExpr, delInvokeArg, m) | _ -> ValueNone @@ -11080,7 +11080,8 @@ let mkRangeCount g m rangeTy rangeExpr start step finish = | _ -> mkRuntimeCalc mkThrowIfStepIsZero (mkCount id) (mkCount mkAddOne) -let mkOptimizedRangeLoop (g: TcGlobals) (mBody, mFor, mIn, spInWhile) (rangeTy, rangeExpr) (start, step, finish) (buildLoop: (Count -> ((Idx -> Elem -> Body) -> Loop) -> Expr)) = +let mkOptimizedRangeLoop (g: TcGlobals) (mBody, mFor, mIn, spInWhile) (rangeTy, rangeExpr) (start, step, finish) (buildLoop: + Count -> ((Idx -> Elem -> Body) -> Loop) -> Expr) = let inline mkLetBindingsIfNeeded f = match start, step, finish with | (Expr.Const _ | Expr.Val _), (Expr.Const _ | Expr.Val _), (Expr.Const _ | Expr.Val _) -> @@ -11594,7 +11595,7 @@ let rec isReturnsResumableCodeTy g ty = let (|ResumableCodeInvoke|_|) g expr = match expr with // defn.Invoke x --> let arg = x in [defn][arg/x] - | Expr.App ((Expr.Val (invokeRef, _, _) as iref), a, b, (f :: args), m) + | Expr.App (Expr.Val (invokeRef, _, _) as iref, a, b, f :: args, m) when invokeRef.LogicalName = "Invoke" && isReturnsResumableCodeTy g (tyOfExpr g f) -> ValueSome (iref, f, args, m, (fun (f2, args2) -> Expr.App ((iref, a, b, (f2 :: args2), m)))) | _ -> ValueNone diff --git a/src/Compiler/TypedTree/TypedTreeOps.fsi b/src/Compiler/TypedTree/TypedTreeOps.fsi index ed847cc5839..72601a04aad 100755 --- a/src/Compiler/TypedTree/TypedTreeOps.fsi +++ b/src/Compiler/TypedTree/TypedTreeOps.fsi @@ -2911,7 +2911,7 @@ type TraitConstraintInfo with /// This will match anything that does not have any types or bindings. [] val (|EmptyModuleOrNamespaces|_|): - moduleOrNamespaceContents: ModuleOrNamespaceContents -> (ModuleOrNamespace list) voption + moduleOrNamespaceContents: ModuleOrNamespaceContents -> ModuleOrNamespace list voption val tryFindExtensionAttribute: g: TcGlobals -> attribs: Attrib list -> Attrib option diff --git a/src/Compiler/TypedTree/TypedTreePickle.fs b/src/Compiler/TypedTree/TypedTreePickle.fs index 2ac62b02787..72200e32fd8 100644 --- a/src/Compiler/TypedTree/TypedTreePickle.fs +++ b/src/Compiler/TypedTree/TypedTreePickle.fs @@ -252,8 +252,8 @@ let p_int32B n st = if n >= 0 && n <= 0x7F then p_byteB (b0 n) st else if n >= 0x80 && n <= 0x3FFF then - p_byteB ((0x80 ||| (n >>> 8))) st - p_byteB ((n &&& 0xFF)) st + p_byteB (0x80 ||| (n >>> 8)) st + p_byteB (n &&& 0xFF) st else p_byteB 0xFF st prim_p_int32B n st @@ -1323,7 +1323,7 @@ let u_ILTypeRef st = ILTypeRef.Create(a, b, c) let u_ILArrayShape = - u_wrap (ILArrayShape) (u_list (u_tup2 (u_option u_int32) (u_option u_int32))) + u_wrap ILArrayShape (u_list (u_tup2 (u_option u_int32) (u_option u_int32))) let rec u_ILType st = let tag = u_byte st diff --git a/src/Compiler/Utilities/Activity.fs b/src/Compiler/Utilities/Activity.fs index 6b1a5754436..6ceaaa51eab 100644 --- a/src/Compiler/Utilities/Activity.fs +++ b/src/Compiler/Utilities/Activity.fs @@ -285,9 +285,9 @@ module internal Activity = appendWithLeadingComma (a.StartTimeUtc.ToString("HH-mm-ss.ffff")) appendWithLeadingComma ((a.StartTimeUtc + a.Duration).ToString("HH-mm-ss.ffff")) appendWithLeadingComma (a.Duration.TotalSeconds.ToString("000.0000", System.Globalization.CultureInfo.InvariantCulture)) - appendWithLeadingComma (a.Id) - appendWithLeadingComma (a.ParentId) - appendWithLeadingComma (a.RootId) + appendWithLeadingComma a.Id + appendWithLeadingComma a.ParentId + appendWithLeadingComma a.RootId Tags.AllKnownTags |> Array.iter (a.GetTagItem >> escapeStringForCsv >> appendWithLeadingComma) diff --git a/src/Compiler/Utilities/FileSystem.fs b/src/Compiler/Utilities/FileSystem.fs index ce2488cd0aa..a19df26aad1 100644 --- a/src/Compiler/Utilities/FileSystem.fs +++ b/src/Compiler/Utilities/FileSystem.fs @@ -934,7 +934,7 @@ type internal ByteBuffer = member inline private buf.CheckDisposed() = if buf.isDisposed then - raise (ObjectDisposedException(nameof (ByteBuffer))) + raise (ObjectDisposedException(nameof ByteBuffer)) member private buf.Ensure newSize = let oldBufSize = buf.bbArray.Length diff --git a/src/Compiler/Utilities/LruCache.fs b/src/Compiler/Utilities/LruCache.fs index e2decd71735..210c5d403f2 100644 --- a/src/Compiler/Utilities/LruCache.fs +++ b/src/Compiler/Utilities/LruCache.fs @@ -214,7 +214,7 @@ type internal LruCache<'TKey, 'TVersion, 'TValue | false, _ -> [] | true, versionDict -> versionDict.Values - |> Seq.map (_.Value) + |> Seq.map _.Value |> Seq.sortBy (function | _, _, _, Strong _ -> 0 | _ -> 1) diff --git a/src/Compiler/Utilities/TaggedCollections.fs b/src/Compiler/Utilities/TaggedCollections.fs index cb6add28b10..d16f33aebc9 100644 --- a/src/Compiler/Utilities/TaggedCollections.fs +++ b/src/Compiler/Utilities/TaggedCollections.fs @@ -70,19 +70,19 @@ module SetTree = let t2h = height t2 if t2h > t1h + tolerance then // right is heavier than left - let t2' = asNode (t2) + let t2' = asNode t2 // one of the nodes must have height > height t1 + 1 if height t2'.Left > t1h + 1 then // balance left: combination - let t2l = asNode (t2'.Left) + let t2l = asNode t2'.Left mk (mk t1 v t2l.Left) t2l.Key (mk t2l.Right t2'.Key t2'.Right) else // rotate left mk (mk t1 v t2'.Left) t2.Key t2'.Right else if t1h > t2h + tolerance then // left is heavier than right - let t1' = asNode (t1) + let t1' = asNode t1 // one of the nodes must have height > height t2 + 1 if height t1'.Right > t2h + 1 then // balance right: combination - let t1r = asNode (t1'.Right) + let t1r = asNode t1'.Right mk (mk t1'.Left t1.Key t1r.Left) t1r.Key (mk t1r.Right v t2) else mk t1'.Left t1'.Key (mk t1'.Right v t2) @@ -766,19 +766,19 @@ module MapTree = let t2h = height t2 if t2h > t1h + 2 then (* right is heavier than left *) - let t2' = asNode (t2) + let t2' = asNode t2 (* one of the nodes must have height > height t1 + 1 *) if height t2'.Left > t1h + 1 then (* balance left: combination *) - let t2l = asNode (t2'.Left) + let t2l = asNode t2'.Left mk (mk t1 k v t2l.Left) t2l.Key t2l.Value (mk t2l.Right t2'.Key t2'.Value t2'.Right) else (* rotate left *) mk (mk t1 k v t2'.Left) t2'.Key t2'.Value t2'.Right else if t1h > t2h + 2 then (* left is heavier than right *) - let t1' = asNode (t1) + let t1' = asNode t1 (* one of the nodes must have height > height t2 + 1 *) if height t1'.Right > t2h + 1 then (* balance right: combination *) - let t1r = asNode (t1'.Right) + let t1r = asNode t1'.Right mk (mk t1'.Left t1'.Key t1'.Value t1r.Left) t1r.Key t1r.Value (mk t1r.Right k v t2) else mk t1'.Left t1'.Key t1'.Value (mk t1'.Right k v t2) diff --git a/src/Compiler/Utilities/TypeHashing.fs b/src/Compiler/Utilities/TypeHashing.fs index f984a32d4e1..d9b8ede6f60 100644 --- a/src/Compiler/Utilities/TypeHashing.fs +++ b/src/Compiler/Utilities/TypeHashing.fs @@ -23,7 +23,7 @@ module internal HashingPrimitives = let inline hashText (s: string) : Hash = hash s let inline combineHash acc y : Hash = (acc <<< 1) + y + 631 let inline pipeToHash (value: Hash) (acc: Hash) = combineHash acc value - let inline addFullStructuralHash (value) (acc: Hash) = combineHash (acc) (hash value) + let inline addFullStructuralHash value (acc: Hash) = combineHash acc (hash value) let inline hashListOrderMatters ([] func) (items: #seq<'T>) : Hash = let mutable acc = 0 @@ -97,7 +97,7 @@ module HashIL = | ILType.Void -> hash ILType.Void | ILType.Array(sh, t) -> hashILType t @@ hashILArrayShape sh | ILType.Value t - | ILType.Boxed t -> hashILTypeRef t.TypeRef @@ (t.GenericArgs |> hashListOrderMatters (hashILType)) + | ILType.Boxed t -> hashILTypeRef t.TypeRef @@ (t.GenericArgs |> hashListOrderMatters hashILType) | ILType.Ptr t | ILType.Byref t -> hashILType t | ILType.FunctionPointer t -> hashILCallingSignature t @@ -106,7 +106,7 @@ module HashIL = and hashILCallingSignature (signature: ILCallingSignature) = let res = signature.ReturnType |> hashILType - signature.ArgTypes |> hashListOrderMatters (hashILType) |> pipeToHash res + signature.ArgTypes |> hashListOrderMatters hashILType |> pipeToHash res module HashAccessibility = @@ -140,8 +140,8 @@ module rec HashTypes = let private hashTyparRef (typar: Typar) = hashText typar.DisplayName - |> addFullStructuralHash (typar.Rigidity) - |> addFullStructuralHash (typar.StaticReq) + |> addFullStructuralHash typar.Rigidity + |> addFullStructuralHash typar.StaticReq let private hashTyparRefWithInfo (typar: Typar) = hashTyparRef typar @@ hashAttributeList typar.Attribs @@ -163,7 +163,7 @@ module rec HashTypes = | TyparConstraint.IsReferenceType _ -> tpHash @@ 11 | TyparConstraint.SimpleChoice(tys, _) -> tpHash @@ 12 @@ (tys |> hashListOrderIndependent (hashTType g)) | TyparConstraint.RequiresDefaultConstructor _ -> tpHash @@ 13 - | TyparConstraint.NotSupportsNull(_) -> tpHash @@ 14 + | TyparConstraint.NotSupportsNull _ -> tpHash @@ 14 | TyparConstraint.AllowsRefStruct _ -> tpHash @@ 15 /// Hash type parameter constraints @@ -181,8 +181,8 @@ module rec HashTypes = traitInfo.CompiledObjectAndArgumentTypes |> hashListOrderIndependent (hashTType g) - |> pipeToHash (nameHash) - |> pipeToHash (returnTypeHash) + |> pipeToHash nameHash + |> pipeToHash returnTypeHash |> pipeToHash memberHash /// Hash a unit of measure expression @@ -210,7 +210,7 @@ module rec HashTypes = |> hashListOrderMatters (hashTType g) |> addFullStructuralHash (evalTupInfoIsStruct tupInfo) // Hash a first-class generic type. - | TType_forall(tps, tau) -> tps |> hashListOrderMatters (hashTyparRef) |> pipeToHash (hashTType g tau) + | TType_forall(tps, tau) -> tps |> hashListOrderMatters hashTyparRef |> pipeToHash (hashTType g tau) | TType_fun _ -> let argTys, retTy = stripFunTy g ty argTys |> hashListOrderMatters (hashTType g) |> pipeToHash (hashTType g retTy) diff --git a/src/Compiler/Utilities/illib.fs b/src/Compiler/Utilities/illib.fs index b4aec4f0393..ee33e444803 100644 --- a/src/Compiler/Utilities/illib.fs +++ b/src/Compiler/Utilities/illib.fs @@ -144,7 +144,7 @@ module internal PervasiveAutoOpens = let task = ts.Task - Async.StartWithContinuations(computation, (ts.SetResult), (ts.SetException), (fun _ -> ts.SetCanceled()), cancellationToken) + Async.StartWithContinuations(computation, ts.SetResult, ts.SetException, (fun _ -> ts.SetCanceled()), cancellationToken) try task.Result @@ -944,7 +944,7 @@ type UniqueStampGenerator<'T when 'T: equality and 'T: not null>() = let encodeTable = ConcurrentDictionary<'T, Lazy>(HashIdentity.Structural) let mutable nItems = -1 - let computeFunc = Func<'T, _>(fun _ -> lazy (Interlocked.Increment(&nItems))) + let computeFunc = Func<'T, _>(fun _ -> lazy Interlocked.Increment(&nItems)) member _.Encode str = encodeTable.GetOrAdd(str, computeFunc).Value @@ -980,7 +980,7 @@ type internal StampedDictionary<'T, 'U when 'T: not null>(keyComparer: IEquality member _.UpdateIfExists(key, valueReplaceFunc) = match table.TryGetValue key with | true, v -> - let (stamp, oldVal) = v.Value + let stamp, oldVal = v.Value match valueReplaceFunc oldVal with | None -> () @@ -1061,7 +1061,7 @@ type LazyWithContext<'T, 'Ctxt> = // Re-raise the original exception raise (x.findOriginalException res.Exception) | :? ('Ctxt -> 'T) as f -> - x.funcOrException <- box (LazyWithContextFailure.Undefined) + x.funcOrException <- box LazyWithContextFailure.Undefined try let res = f ctxt diff --git a/src/Compiler/Utilities/lib.fsi b/src/Compiler/Utilities/lib.fsi index fcf977683d3..a01721d1b13 100644 --- a/src/Compiler/Utilities/lib.fsi +++ b/src/Compiler/Utilities/lib.fsi @@ -19,7 +19,7 @@ val isEnvVarSet: s: string -> bool val GetEnvInteger: e: string -> dflt: int -> int -val dispose: x: (System.IDisposable MaybeNull) -> unit +val dispose: x: System.IDisposable MaybeNull -> unit module Bits = /// Get the least significant byte of a 32-bit integer diff --git a/src/Compiler/Utilities/sr.fs b/src/Compiler/Utilities/sr.fs index 968525e931e..2c7be70df0d 100644 --- a/src/Compiler/Utilities/sr.fs +++ b/src/Compiler/Utilities/sr.fs @@ -10,7 +10,7 @@ open Internal.Utilities.Library module internal SR = let private resources = - lazy (System.Resources.ResourceManager("fsstrings", System.Reflection.Assembly.GetExecutingAssembly())) + lazy System.Resources.ResourceManager("fsstrings", System.Reflection.Assembly.GetExecutingAssembly()) let GetString (name: string) = let s = @@ -34,7 +34,7 @@ module internal DiagnosticMessage = not (ty.IsArray || ty.IsByRef || ty.IsPointer) let isFunctionType (ty1: System.Type) = - isNamedType (ty1) + isNamedType ty1 && ty1.IsGenericType && System.Type.op_Equality (ty1.GetGenericTypeDefinition(), funTyC) diff --git a/src/FSharp.Core/Linq.fs b/src/FSharp.Core/Linq.fs index 5793f99c596..f6bb324f4cc 100644 --- a/src/FSharp.Core/Linq.fs +++ b/src/FSharp.Core/Linq.fs @@ -45,7 +45,7 @@ module LeafExpressionConverter = else Type.op_Equality(ty1, ty2) - let isFunctionType typ = equivHeadTypes typ (typeof<(int -> int)>) + let isFunctionType typ = equivHeadTypes typ typeof int> let getFunctionType typ = if not (isFunctionType typ) then invalidArg "typ" "cannot convert recursion except for function types" @@ -308,7 +308,7 @@ module LeafExpressionConverter = let (|NullableModuloNullableQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun (x, y) -> NullableOperators.( ?%? ) x y)) let (|ModuloNullableQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun (x, y) -> NullableOperators.( %? ) x y)) - let (|NotQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (not)) + let (|NotQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof not) let (|NegQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun (x:int) -> -x)) let (|PlusQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun (x, y) -> x + y)) let (|DivideQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun (x, y) -> x / y)) @@ -321,71 +321,72 @@ module LeafExpressionConverter = let (|BitwiseOrQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun (x, y) -> x ||| y)) let (|BitwiseXorQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun (x, y) -> x ^^^ y)) let (|BitwiseNotQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof ( ~~~ )) - let (|CheckedNeg|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Checked.( ~-))) + let (|CheckedNeg|_|) = (|SpecificCallToMethod|_|) (methodhandleof Checked.( ~-)) let (|CheckedPlusQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun (x, y) -> Checked.( + ) x y)) let (|CheckedMinusQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun (x, y) -> Checked.( - ) x y)) let (|CheckedMultiplyQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun (x, y) -> Checked.( * ) x y)) - let (|ConvCharQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (char)) - let (|ConvDecimalQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (decimal)) - let (|ConvFloatQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (float)) - let (|ConvFloat32Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (float32)) - let (|ConvSByteQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (sbyte)) - - let (|ConvInt16Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (int16)) - let (|ConvInt32Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (int32)) - let (|ConvIntQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (int)) - let (|ConvInt64Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (int64)) - let (|ConvByteQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (byte)) - let (|ConvUInt16Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (uint16)) - let (|ConvUInt32Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (uint32)) - let (|ConvUInt64Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (uint64)) - let (|ConvIntPtrQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (nativeint)) - let (|ConvUIntPtrQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (unativeint)) + let (|ConvCharQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof char) + let (|ConvDecimalQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof decimal) + let (|ConvFloatQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof float) + let (|ConvFloat32Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof float32) + let (|ConvSByteQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof sbyte) + + let (|ConvInt16Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof int16) + let (|ConvInt32Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof int32) + let (|ConvIntQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof int) + let (|ConvInt64Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof int64) + let (|ConvByteQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof byte) + let (|ConvUInt16Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof uint16) + let (|ConvUInt32Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof uint32) + let (|ConvUInt64Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof uint64) + let (|ConvIntPtrQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof nativeint) + let (|ConvUIntPtrQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof unativeint) let (|ConvInt8Q|_|) = SpecificCallToMethodInfo (typeof.Assembly.GetType("Microsoft.FSharp.Core.ExtraTopLevelOperators").GetMethod("ToSByte")) let (|ConvUInt8Q|_|) = SpecificCallToMethodInfo (typeof.Assembly.GetType("Microsoft.FSharp.Core.ExtraTopLevelOperators").GetMethod("ToByte")) let (|ConvDoubleQ|_|) = SpecificCallToMethodInfo (typeof.Assembly.GetType("Microsoft.FSharp.Core.ExtraTopLevelOperators").GetMethod("ToDouble")) let (|ConvSingleQ|_|) = SpecificCallToMethodInfo (typeof.Assembly.GetType("Microsoft.FSharp.Core.ExtraTopLevelOperators").GetMethod("ToSingle")) - let (|ConvNullableCharQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Nullable.char)) - let (|ConvNullableDecimalQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Nullable.decimal)) - let (|ConvNullableFloatQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Nullable.float)) - let (|ConvNullableDoubleQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Nullable.double)) - let (|ConvNullableFloat32Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Nullable.float32)) - let (|ConvNullableSingleQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Nullable.single)) - let (|ConvNullableSByteQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Nullable.sbyte)) - let (|ConvNullableInt8Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Nullable.int8)) - let (|ConvNullableInt16Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Nullable.int16)) - let (|ConvNullableInt32Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Nullable.int32)) - let (|ConvNullableIntQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Nullable.int)) - let (|ConvNullableInt64Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Nullable.int64)) - let (|ConvNullableByteQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Nullable.byte)) - let (|ConvNullableUInt8Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Nullable.uint8)) - let (|ConvNullableUInt16Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Nullable.uint16)) - let (|ConvNullableUInt32Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Nullable.uint32)) - let (|ConvNullableUInt64Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Nullable.uint64)) - let (|ConvNullableIntPtrQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Nullable.nativeint)) - let (|ConvNullableUIntPtrQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Nullable.unativeint)) + let (|ConvNullableCharQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof Nullable.char) + let (|ConvNullableDecimalQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof Nullable.decimal) + let (|ConvNullableFloatQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof Nullable.float) + let (|ConvNullableDoubleQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof Nullable.double) + let (|ConvNullableFloat32Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof Nullable.float32) + let (|ConvNullableSingleQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof Nullable.single) + let (|ConvNullableSByteQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof Nullable.sbyte) + let (|ConvNullableInt8Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof Nullable.int8) + let (|ConvNullableInt16Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof Nullable.int16) + let (|ConvNullableInt32Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof Nullable.int32) + let (|ConvNullableIntQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof Nullable.int) + let (|ConvNullableInt64Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof Nullable.int64) + let (|ConvNullableByteQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof Nullable.byte) + let (|ConvNullableUInt8Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof Nullable.uint8) + let (|ConvNullableUInt16Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof Nullable.uint16) + let (|ConvNullableUInt32Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof Nullable.uint32) + let (|ConvNullableUInt64Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof Nullable.uint64) + let (|ConvNullableIntPtrQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof Nullable.nativeint) + let (|ConvNullableUIntPtrQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof Nullable.unativeint) let (|UnboxGeneric|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> LanguagePrimitives.IntrinsicFunctions.UnboxGeneric x)) let (|TypeTestGeneric|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> LanguagePrimitives.IntrinsicFunctions.TypeTestGeneric x)) - let (|CheckedConvCharQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Checked.char)) - let (|CheckedConvSByteQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Checked.sbyte)) + let (|CheckedConvCharQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof Checked.char) + let (|CheckedConvSByteQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof Checked.sbyte) let (|CheckedConvInt8Q|_|) = SpecificCallToMethodInfo (typeof.Assembly.GetType("Microsoft.FSharp.Core.ExtraTopLevelOperators+Checked").GetMethod("ToSByte")) let (|CheckedConvUInt8Q|_|) = SpecificCallToMethodInfo (typeof.Assembly.GetType("Microsoft.FSharp.Core.ExtraTopLevelOperators+Checked").GetMethod("ToByte")) - let (|CheckedConvInt16Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Checked.int16)) - let (|CheckedConvInt32Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Checked.int32)) - let (|CheckedConvInt64Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Checked.int64)) - let (|CheckedConvByteQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Checked.byte)) - let (|CheckedConvUInt16Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Checked.uint16)) - let (|CheckedConvUInt32Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Checked.uint32)) - let (|CheckedConvUInt64Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Checked.uint64)) - let (|CheckedConvIntPtrQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Checked.nativeint)) - let (|CheckedConvUIntPtrQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (Checked.unativeint)) - let (|ImplicitExpressionConversionHelperQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (ImplicitExpressionConversionHelper)) - let (|MemberInitializationHelperQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (MemberInitializationHelper)) - let (|NewAnonymousObjectHelperQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (NewAnonymousObjectHelper)) + let (|CheckedConvInt16Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof Checked.int16) + let (|CheckedConvInt32Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof Checked.int32) + let (|CheckedConvInt64Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof Checked.int64) + let (|CheckedConvByteQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof Checked.byte) + let (|CheckedConvUInt16Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof Checked.uint16) + let (|CheckedConvUInt32Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof Checked.uint32) + let (|CheckedConvUInt64Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof Checked.uint64) + let (|CheckedConvIntPtrQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof Checked.nativeint) + let (|CheckedConvUIntPtrQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof Checked.unativeint) + let (|ImplicitExpressionConversionHelperQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof + ImplicitExpressionConversionHelper) + let (|MemberInitializationHelperQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof MemberInitializationHelper) + let (|NewAnonymousObjectHelperQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof NewAnonymousObjectHelper) let (|ArrayLookupQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun (x, y) -> LanguagePrimitives.IntrinsicFunctions.GetArray x y)) //let (|ArrayAssignQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun -> LanguagePrimitives.IntrinsicFunctions.SetArray : int array -> int -> int -> unit)) @@ -418,7 +419,7 @@ module LeafExpressionConverter = /// Extract nullable constructions let (|NullableConstruction|_|) = function - | NewObject(c, [arg]) when equivHeadTypes c.DeclaringType (typeof>) -> Some arg + | NewObject(c, [arg]) when equivHeadTypes c.DeclaringType typeof> -> Some arg | _ -> None /// Convert F# quotations to LINQ expression trees. @@ -562,7 +563,9 @@ module LeafExpressionConverter = | MakeDecimalQ (_, _, [Int32 lo; Int32 med; Int32 hi; Bool isNegative; Byte scale]) -> Expression.Constant (System.Decimal(lo, med, hi, isNegative, scale)) |> asExpr - | NegQ (_, _, [x]) -> transUnaryOp isLinqExpressionsArithmeticTypeButNotUnsignedInt inp env x Expression.Negate (methodhandleof (LanguagePrimitives.UnaryNegationDynamic)) + | NegQ (_, _, [x]) -> transUnaryOp isLinqExpressionsArithmeticTypeButNotUnsignedInt inp env x Expression.Negate (methodhandleof + LanguagePrimitives.UnaryNegationDynamic + ) | PlusQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env false x1 x2 false Expression.Add (methodhandleof (fun (x, y) -> LanguagePrimitives.AdditionDynamic x y)) | MinusQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env false x1 x2 false Expression.Subtract (methodhandleof (fun (x, y) -> LanguagePrimitives.SubtractionDynamic x y)) | MultiplyQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env false x1 x2 false Expression.Multiply (methodhandleof (fun (x, y) -> LanguagePrimitives.MultiplyDynamic x y)) @@ -574,7 +577,9 @@ module LeafExpressionConverter = | BitwiseAndQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsIntegerOrBool inp env false x1 x2 false Expression.And (methodhandleof (fun (x, y) -> LanguagePrimitives.BitwiseAndDynamic x y)) | BitwiseOrQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsIntegerOrBool inp env false x1 x2 false Expression.Or (methodhandleof (fun (x, y) -> LanguagePrimitives.BitwiseOrDynamic x y)) | BitwiseXorQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsIntegerOrBool inp env false x1 x2 false Expression.ExclusiveOr (methodhandleof (fun (x, y) -> LanguagePrimitives.ExclusiveOrDynamic x y)) - | BitwiseNotQ (_, _, [x]) -> transUnaryOp isLinqExpressionsIntegerOrBool inp env x Expression.Not (methodhandleof (LanguagePrimitives.LogicalNotDynamic)) + | BitwiseNotQ (_, _, [x]) -> transUnaryOp isLinqExpressionsIntegerOrBool inp env x Expression.Not (methodhandleof + LanguagePrimitives.LogicalNotDynamic + ) | CheckedNeg (_, _, [x]) -> transUnaryOp isLinqExpressionsArithmeticTypeButNotUnsignedInt inp env x Expression.NegateChecked (methodhandleof (fun x -> LanguagePrimitives.CheckedUnaryNegationDynamic x)) | CheckedPlusQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env false x1 x2 false Expression.AddChecked (methodhandleof (fun (x, y) -> LanguagePrimitives.CheckedAdditionDynamic x y)) @@ -714,7 +719,7 @@ module LeafExpressionConverter = Expression.Equal(tagE, Expression.Constant(unionCaseInfo.Tag)) |> asExpr #endif - | (NewObject(ctorInfo, args) as x) -> + | NewObject(ctorInfo, args) as x -> match x with // LINQ providers prefer C# "Nullable x" to be "Convert x", since that's what C# uses // to construct nullable values. @@ -738,7 +743,7 @@ module LeafExpressionConverter = let rec build ty (argsP: Expression array) = match FSharpValue.PreComputeTupleConstructorInfo ty with | ctorInfo, None -> Expression.New(ctorInfo, argsP) |> asExpr - | ctorInfo, Some (nestedTy) -> + | ctorInfo, Some nestedTy -> let n = ctorInfo.GetParameters().Length - 1 Expression.New(ctorInfo, Array.append argsP.[0..n-1] [| build nestedTy argsP.[n..] |]) |> asExpr build tupTy argsP @@ -865,7 +870,9 @@ module LeafExpressionConverter = if isLinqExpressionsConvertible e.Type inp.Type then exprErasedConstructor(e, inp.Type, null) else - let method = MethodInfo.GetMethodFromHandle (if isChecked then methodhandleof (LanguagePrimitives.CheckedExplicitDynamic) else methodhandleof (LanguagePrimitives.ExplicitDynamic)) :?> MethodInfo + let method = MethodInfo.GetMethodFromHandle (if isChecked then methodhandleof + LanguagePrimitives.CheckedExplicitDynamic + else methodhandleof LanguagePrimitives.ExplicitDynamic) :?> MethodInfo exprErasedConstructor(e, inp.Type, method.MakeGenericMethod [| getNonNullableType x.Type; getNonNullableType inp.Type |]) |> asExpr diff --git a/src/FSharp.Core/Query.fs b/src/FSharp.Core/Query.fs index eb4a5100db1..88d4781ec22 100644 --- a/src/FSharp.Core/Query.fs +++ b/src/FSharp.Core/Query.fs @@ -44,8 +44,8 @@ module ForwardDeclarations = let mutable Query = { new IQueryMethods with - member _.Execute(_) = failwith "IQueryMethods.Execute should never be called" - member _.EliminateNestedQueries(_) = failwith "IQueryMethods.EliminateNestedQueries should never be called" + member _.Execute _ = failwith "IQueryMethods.Execute should never be called" + member _.EliminateNestedQueries _ = failwith "IQueryMethods.EliminateNestedQueries should never be called" } type QueryBuilder() = @@ -152,7 +152,7 @@ type QueryBuilder() = let source = source.Source checkNonNull "source" source use e = source.GetEnumerator() - let mutable acc : ^Value = LanguagePrimitives.GenericZero< (^Value) > + let mutable acc : ^Value = LanguagePrimitives.GenericZero< ^Value > while e.MoveNext() do let v : Nullable< ^Value > = valueSelector e.Current if v.HasValue then @@ -173,14 +173,14 @@ type QueryBuilder() = let source = source.Source checkNonNull "source" source use e = source.GetEnumerator() - let mutable acc = LanguagePrimitives.GenericZero< (^Value) > + let mutable acc = LanguagePrimitives.GenericZero< ^Value > let mutable count = 0 while e.MoveNext() do let v = projection e.Current if v.HasValue then acc <- plus acc v.Value count <- count + 1 - if count = 0 then Nullable() else Nullable(LanguagePrimitives.DivideByInt< (^Value) > acc count) + if count = 0 then Nullable() else Nullable(LanguagePrimitives.DivideByInt< ^Value > acc count) member inline _.AverageBy< 'T, 'Q, ^Value when ^Value : (static member ( + ) : ^Value * ^Value -> ^Value) @@ -192,20 +192,20 @@ type QueryBuilder() = let source = source.Source checkNonNull "source" source use e = source.GetEnumerator() - let mutable acc = LanguagePrimitives.GenericZero< (^U) > + let mutable acc = LanguagePrimitives.GenericZero< ^U > let mutable count = 0 while e.MoveNext() do acc <- plus acc (projection e.Current) count <- count + 1 if count = 0 then invalidOp "source" - LanguagePrimitives.DivideByInt< (^U) > acc count + LanguagePrimitives.DivideByInt< ^U > acc count member inline _.SumBy< 'T, 'Q, ^Value when ^Value : (static member ( + ) : ^Value * ^Value -> ^Value) and ^Value : (static member Zero : ^Value) and default ^Value : int > - (source: QuerySource<'T, 'Q>, projection : ('T -> ^Value)) : ^Value = + (source: QuerySource<'T, 'Q>, projection : 'T -> ^Value) : ^Value = Seq.sumBy projection source.Source @@ -399,7 +399,7 @@ module Query = (fun (obj: Expr, tyargs: Type list, args: Expr list) -> Expr.Call (obj, BindGenericStaticMethod methInfo tyargs, args)) let ImplicitExpressionConversionHelperMethodInfo = - methodhandleof (ImplicitExpressionConversionHelper) + methodhandleof ImplicitExpressionConversionHelper |> MethodInfo.GetMethodFromHandle :?> MethodInfo @@ -566,7 +566,7 @@ module Query = let (cq_int32, mq_int32), (ce_int32, me_int32) = MakersCallers2 fq_int32 fe_int32 let (cq_int64, mq_int64), (ce_int64, me_int64) = MakersCallers2 fq_int64 fe_int64 // The F# implementation is an instance method on QueryBuilder - let (CE, ME) = MakersCallersInstance FE + let CE, ME = MakersCallersInstance FE let failDueToUnsupportedInputTypeInSumByOrAverageBy() = invalidOp (SR.GetString(SR.failDueToUnsupportedInputTypeInSumByOrAverageBy)) let Make (qb: Expr, isIQ, src: Expr, v: Var, res: Expr) = @@ -718,21 +718,27 @@ module Query = (if isIQ then CQ else CE) ([srcItemTy], [src]) Make, Call - let MakeFirst, CallFirst = MakeOrCallSimpleOp (methodhandleof (Queryable.First)) (methodhandleof (Enumerable.First)) + let MakeFirst, CallFirst = MakeOrCallSimpleOp (methodhandleof Queryable.First) (methodhandleof Enumerable.First) - let MakeFirstOrDefault, CallFirstOrDefault = MakeOrCallSimpleOp (methodhandleof (Queryable.FirstOrDefault)) (methodhandleof (Enumerable.FirstOrDefault)) + let MakeFirstOrDefault, CallFirstOrDefault = MakeOrCallSimpleOp (methodhandleof Queryable.FirstOrDefault) (methodhandleof + Enumerable.FirstOrDefault + ) - let MakeLast, CallLast = MakeOrCallSimpleOp (methodhandleof (Queryable.Last)) (methodhandleof (Enumerable.Last)) + let MakeLast, CallLast = MakeOrCallSimpleOp (methodhandleof Queryable.Last) (methodhandleof Enumerable.Last) - let MakeLastOrDefault, CallLastOrDefault = MakeOrCallSimpleOp (methodhandleof (Queryable.LastOrDefault)) (methodhandleof (Enumerable.LastOrDefault)) + let MakeLastOrDefault, CallLastOrDefault = MakeOrCallSimpleOp (methodhandleof Queryable.LastOrDefault) (methodhandleof + Enumerable.LastOrDefault + ) - let MakeSingle, CallSingle = MakeOrCallSimpleOp (methodhandleof (Queryable.Single)) (methodhandleof (Enumerable.Single)) + let MakeSingle, CallSingle = MakeOrCallSimpleOp (methodhandleof Queryable.Single) (methodhandleof Enumerable.Single) - let MakeSingleOrDefault, CallSingleOrDefault = MakeOrCallSimpleOp (methodhandleof (Queryable.SingleOrDefault)) (methodhandleof (Enumerable.SingleOrDefault)) + let MakeSingleOrDefault, CallSingleOrDefault = MakeOrCallSimpleOp (methodhandleof Queryable.SingleOrDefault) (methodhandleof + Enumerable.SingleOrDefault + ) - let MakeCount, CallCount = MakeOrCallSimpleOp (methodhandleof (Queryable.Count)) (methodhandleof (Enumerable.Count)) + let MakeCount, CallCount = MakeOrCallSimpleOp (methodhandleof Queryable.Count) (methodhandleof Enumerable.Count) - let MakeDefaultIfEmpty = MakeGenericStaticMethod (methodhandleof (Enumerable.DefaultIfEmpty)) + let MakeDefaultIfEmpty = MakeGenericStaticMethod (methodhandleof Enumerable.DefaultIfEmpty) /// Indicates if we can eliminate redundant 'Select(x=>x)' nodes type CanEliminate = @@ -894,8 +900,8 @@ module Query = (methodhandleof (fun (x, y: Func<_, _>) -> Enumerable.TakeWhile(x, y))) let MakeDistinct = - let FQ = MakeGenericStaticMethod (methodhandleof (Queryable.Distinct)) - let FE = MakeGenericStaticMethod (methodhandleof (Enumerable.Distinct)) + let FQ = MakeGenericStaticMethod (methodhandleof Queryable.Distinct) + let FE = MakeGenericStaticMethod (methodhandleof Enumerable.Distinct) fun (isIQ, srcItemTy, src: Expr) -> if isIQ then FQ ([srcItemTy], [src]) @@ -1121,13 +1127,17 @@ module Query = let (|CallLeftOuterJoin|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun (query:QueryBuilder, arg1, arg2, arg3, arg4, arg5) -> query.LeftOuterJoin(arg1, arg2, arg3, arg4, arg5))) - let (|CallAverageBy|_|) = (|SpecificCall2|_|) (methodhandleof (fun (query:QueryBuilder, arg1: QuerySource, arg2:(double->double)) -> query.AverageBy(arg1, arg2))) + let (|CallAverageBy|_|) = (|SpecificCall2|_|) (methodhandleof (fun (query:QueryBuilder, arg1: QuerySource, arg2: + double->double) -> query.AverageBy(arg1, arg2))) - let (|CallSumBy|_|) = (|SpecificCall2|_|) (methodhandleof (fun (query:QueryBuilder, arg1: QuerySource, arg2:(double->double)) -> query.SumBy(arg1, arg2))) + let (|CallSumBy|_|) = (|SpecificCall2|_|) (methodhandleof (fun (query:QueryBuilder, arg1: QuerySource, arg2: + double->double) -> query.SumBy(arg1, arg2))) - let (|CallAverageByNullable|_|) = (|SpecificCall2|_|) (methodhandleof (fun (query:QueryBuilder, arg1: QuerySource, arg2:(double->Nullable)) -> query.AverageByNullable(arg1, arg2))) + let (|CallAverageByNullable|_|) = (|SpecificCall2|_|) (methodhandleof (fun (query:QueryBuilder, arg1: QuerySource, arg2: + double->Nullable) -> query.AverageByNullable(arg1, arg2))) - let (|CallSumByNullable|_|) = (|SpecificCall2|_|) (methodhandleof (fun (query:QueryBuilder, arg1: QuerySource, arg2:(double->Nullable)) -> query.SumByNullable(arg1, arg2))) + let (|CallSumByNullable|_|) = (|SpecificCall2|_|) (methodhandleof (fun (query:QueryBuilder, arg1: QuerySource, arg2: + double->Nullable) -> query.SumByNullable(arg1, arg2))) let (|CallCount|_|) = (|SpecificCall1|_|) (methodhandleof (fun (query:QueryBuilder, arg1) -> query.Count arg1)) diff --git a/src/FSharp.Core/QueryExtensions.fs b/src/FSharp.Core/QueryExtensions.fs index e4fe4c20ff5..eafdae2d187 100644 --- a/src/FSharp.Core/QueryExtensions.fs +++ b/src/FSharp.Core/QueryExtensions.fs @@ -46,12 +46,12 @@ module internal Adapters = && not (FSharpType.GetRecordFields t |> Array.forall (fun f -> f.CanWrite))) let MemberInitializationHelperMeth = - methodhandleof (LeafExpressionConverter.MemberInitializationHelper) + methodhandleof LeafExpressionConverter.MemberInitializationHelper |> MethodInfo.GetMethodFromHandle :?> MethodInfo let NewAnonymousObjectHelperMeth = - methodhandleof (LeafExpressionConverter.NewAnonymousObjectHelper) + methodhandleof LeafExpressionConverter.NewAnonymousObjectHelper |> MethodInfo.GetMethodFromHandle :?> MethodInfo @@ -74,10 +74,10 @@ module internal Adapters = let rec propSetList acc x = match x with // detect " v.X <- y" - | ((Patterns.PropertySet(Some(Patterns.Var var), _, _, _)) as p) :: xs when var = varArg -> + | Patterns.PropertySet(Some(Patterns.Var var), _, _, _) as p :: xs when var = varArg -> propSetList (p :: acc) xs // skip unit values - | (Patterns.Value(v, _)) :: xs when isNull v -> propSetList acc xs + | Patterns.Value(v, _) :: xs when isNull v -> propSetList acc xs // detect "v" | [ Patterns.Var var ] when var = varArg -> Some acc | _ -> None @@ -111,7 +111,7 @@ module internal Adapters = let tupleToAnonTypeMap = let t = Dictionary() - for (k, v) in tupleTypes do + for k, v in tupleTypes do t.[k] <- v t @@ -119,7 +119,7 @@ module internal Adapters = let anonToTupleTypeMap = let t = Dictionary() - for (k, v) in tupleTypes do + for k, v in tupleTypes do t.[v] <- k t @@ -252,7 +252,7 @@ module internal Adapters = | NoConv -> ty let IsNewAnonymousObjectHelperQ = - let mhandle = (methodhandleof (LeafExpressionConverter.NewAnonymousObjectHelper)) + let mhandle = (methodhandleof LeafExpressionConverter.NewAnonymousObjectHelper) let minfo = (MethodInfo.GetMethodFromHandle mhandle) :?> MethodInfo diff --git a/src/FSharp.Core/array.fs b/src/FSharp.Core/array.fs index 979d0f7ab2e..cc1a0babc66 100644 --- a/src/FSharp.Core/array.fs +++ b/src/FSharp.Core/array.fs @@ -2420,7 +2420,7 @@ module Array = [] let inline averageBy ([] projection: 'T -> ^U) (array: 'T array) : ^U = let sum = array |> reduceBy projection Checked.(+) - LanguagePrimitives.DivideByInt sum (array.Length) + LanguagePrimitives.DivideByInt sum array.Length [] let inline average (array: 'T array) = @@ -2460,7 +2460,7 @@ module Array = let counts = ConcurrentDictionary<_, _>( concurrencyLevel = maxPartitions, - capacity = Operators.min (array.Length) 1_000, + capacity = Operators.min array.Length 1_000, comparer = comparer ) @@ -2509,7 +2509,7 @@ module Array = for elemIdx = chunk.Offset to (chunk.Offset + chunk.Count - 1) do let key = projectedValues[elemIdx] - let (counter, arrayForThisGroup) = finalResultsLookup[key] + let counter, arrayForThisGroup = finalResultsLookup[key] let idxToWrite = Interlocked.Decrement(counter) arrayForThisGroup[idxToWrite] <- array[elemIdx] ) @@ -2524,8 +2524,8 @@ module Array = if typeof<'Key> = typeof || typeof<'Key> = typeof then let genericCmp = HashIdentity.FromFunctions<'Key> - (LanguagePrimitives.GenericHash) - (LanguagePrimitives.GenericEqualityER) + LanguagePrimitives.GenericHash + LanguagePrimitives.GenericEqualityER groupByImplParallel genericCmp keyf id array else diff --git a/src/FSharp.Core/async.fs b/src/FSharp.Core/async.fs index 7e2371cd79a..f18e451f357 100644 --- a/src/FSharp.Core/async.fs +++ b/src/FSharp.Core/async.fs @@ -76,9 +76,9 @@ type AsyncReturn = static member inline Fake() = Unchecked.defaultof -type cont<'T> = ('T -> AsyncReturn) -type econt = (ExceptionDispatchInfo -> AsyncReturn) -type ccont = (OperationCanceledException -> AsyncReturn) +type cont<'T> = 'T -> AsyncReturn +type econt = ExceptionDispatchInfo -> AsyncReturn +type ccont = OperationCanceledException -> AsyncReturn [] type Trampoline() = @@ -219,11 +219,11 @@ type TrampolineHolder() = trampoline.Execute firstAction member this.PostWithTrampoline (syncCtxt: SynchronizationContext) (f: unit -> AsyncReturn) = - syncCtxt.Post(getSendOrPostCallbackWithTrampoline (this), state = (f |> box)) + syncCtxt.Post(getSendOrPostCallbackWithTrampoline this, state = (f |> box)) AsyncReturn.Fake() member this.QueueWorkItemWithTrampoline(f: unit -> AsyncReturn) = - if not (ThreadPool.QueueUserWorkItem(getWaitCallbackForQueueWorkItemWithTrampoline (this), f |> box)) then + if not (ThreadPool.QueueUserWorkItem(getWaitCallbackForQueueWorkItemWithTrampoline this, f |> box)) then failwith "failed to queue user work item" AsyncReturn.Fake() @@ -235,7 +235,7 @@ type TrampolineHolder() = // This should be the only call to Thread.Start in this library. We must always install a trampoline. member this.StartThreadWithTrampoline(f: unit -> AsyncReturn) = - Thread(getThreadStartCallbackForStartThreadWithTrampoline (this), IsBackground = true).Start(f |> box) + Thread(getThreadStartCallbackForStartThreadWithTrampoline this, IsBackground = true).Start(f |> box) AsyncReturn.Fake() @@ -426,7 +426,7 @@ type AsyncActivation<'T>(contents: AsyncActivationContents<'T>) = [] type Async<'T> = { - Invoke: (AsyncActivation<'T> -> AsyncReturn) + Invoke: AsyncActivation<'T> -> AsyncReturn } /// Mutable register to help ensure that code is only executed once @@ -1039,7 +1039,7 @@ module AsyncPrimitives = | Some _ -> result | None -> // Otherwise save the continuation and call it in RegisterResult - savedConts <- (SuspendedAsync<_>(ctxt)) :: savedConts + savedConts <- SuspendedAsync<_>(ctxt) :: savedConts None) match resOpt with @@ -1079,7 +1079,7 @@ module AsyncPrimitives = let obj = FuncDelegate<'T>(f) let invokeMeth = - (typeof>) + typeof> .GetMethod("Invoke", BindingFlags.Public ||| BindingFlags.NonPublic ||| BindingFlags.Instance) Delegate.CreateDelegate(typeof<'Delegate>, obj, invokeMeth) :?> 'Delegate @@ -1767,8 +1767,8 @@ type Async = Async.StartWithContinuations( computation, - (ts.SetResult), - (ts.SetException), + ts.SetResult, + ts.SetException, (fun _ -> ts.SetCanceled()), cancellationToken ) @@ -2042,7 +2042,7 @@ type Async = ) static member AsBeginEnd<'Arg, 'T> - (computation: ('Arg -> Async<'T>)) + (computation: 'Arg -> Async<'T>) // The 'Begin' member : ('Arg * AsyncCallback * objnull -> IAsyncResult) * (IAsyncResult -> 'T) * (IAsyncResult -> unit) = let beginAction = diff --git a/src/FSharp.Core/async.fsi b/src/FSharp.Core/async.fsi index c55fc0537c9..5c1dadd4135 100644 --- a/src/FSharp.Core/async.fsi +++ b/src/FSharp.Core/async.fsi @@ -647,7 +647,7 @@ namespace Microsoft.FSharp.Control /// Threads and Contexts /// /// - static member SwitchToContext : syncContext:(SynchronizationContext | null) -> Async + static member SwitchToContext : syncContext: SynchronizationContext | null -> Async /// Creates an asynchronous computation that captures the current /// success, exception and cancellation continuations. The callback must diff --git a/src/FSharp.Core/collections.fs b/src/FSharp.Core/collections.fs index 6a52a10cde5..7899c5151cb 100644 --- a/src/FSharp.Core/collections.fs +++ b/src/FSharp.Core/collections.fs @@ -12,7 +12,7 @@ module HashIdentity = let inline Structural<'T when 'T: equality> : IEqualityComparer<'T> = LanguagePrimitives.FastGenericEqualityComparer<'T> - let inline LimitedStructural<'T when 'T: equality> (limit) : IEqualityComparer<'T> = + let inline LimitedStructural<'T when 'T: equality> limit : IEqualityComparer<'T> = LanguagePrimitives.FastLimitedGenericEqualityComparer<'T>(limit) let Reference<'T when 'T: not struct> : IEqualityComparer<'T> = diff --git a/src/FSharp.Core/event.fs b/src/FSharp.Core/event.fs index 819e8d10448..a4eac84a9fa 100644 --- a/src/FSharp.Core/event.fs +++ b/src/FSharp.Core/event.fs @@ -55,23 +55,23 @@ type EventDelegee<'Args>(observer: IObserver<'Args>) = observer.OnNext args member x.Invoke(_sender: objnull, a, b) = - let args = makeTuple ([| a; b |]) :?> 'Args + let args = makeTuple [| a; b |] :?> 'Args observer.OnNext args member x.Invoke(_sender: objnull, a, b, c) = - let args = makeTuple ([| a; b; c |]) :?> 'Args + let args = makeTuple [| a; b; c |] :?> 'Args observer.OnNext args member x.Invoke(_sender: objnull, a, b, c, d) = - let args = makeTuple ([| a; b; c; d |]) :?> 'Args + let args = makeTuple [| a; b; c; d |] :?> 'Args observer.OnNext args member x.Invoke(_sender: objnull, a, b, c, d, e) = - let args = makeTuple ([| a; b; c; d; e |]) :?> 'Args + let args = makeTuple [| a; b; c; d; e |] :?> 'Args observer.OnNext args member x.Invoke(_sender: objnull, a, b, c, d, e, f) = - let args = makeTuple ([| a; b; c; d; e; f |]) :?> 'Args + let args = makeTuple [| a; b; c; d; e; f |] :?> 'Args observer.OnNext args type EventWrapper<'Delegate, 'Args> = delegate of 'Delegate * objnull * 'Args -> unit diff --git a/src/FSharp.Core/fslib-extra-pervasives.fs b/src/FSharp.Core/fslib-extra-pervasives.fs index 3bded43b24c..924f057b7e1 100644 --- a/src/FSharp.Core/fslib-extra-pervasives.fs +++ b/src/FSharp.Core/fslib-extra-pervasives.fs @@ -129,13 +129,13 @@ module ExtraTopLevelOperators = interface ICollection> with - member _.Add(_) = + member _.Add _ = raise (NotSupportedException(SR.GetString(SR.thisValueCannotBeMutated))) member _.Clear() = raise (NotSupportedException(SR.GetString(SR.thisValueCannotBeMutated))) - member _.Remove(_) = + member _.Remove _ = raise (NotSupportedException(SR.GetString(SR.thisValueCannotBeMutated))) member _.Contains(KeyValue(k, v)) = @@ -144,7 +144,7 @@ module ExtraTopLevelOperators = member _.CopyTo(arr, i) = let mutable n = 0 - for (KeyValue(k, v)) in t do + for KeyValue(k, v) in t do arr.[i + n] <- KeyValuePair<_, _>(getKey k, v) n <- n + 1 @@ -160,7 +160,7 @@ module ExtraTopLevelOperators = member _.GetEnumerator() = // We use an array comprehension here instead of seq {} as otherwise we get incorrect // IEnumerator.Reset() and IEnumerator.Current semantics. - let kvps = [| for (KeyValue(k, v)) in t -> KeyValuePair(getKey k, v) |] :> seq<_> + let kvps = [| for KeyValue(k, v) in t -> KeyValuePair(getKey k, v) |] :> seq<_> kvps.GetEnumerator() interface System.Collections.IEnumerable with @@ -168,7 +168,7 @@ module ExtraTopLevelOperators = // We use an array comprehension here instead of seq {} as otherwise we get incorrect // IEnumerator.Reset() and IEnumerator.Current semantics. let kvps = - [| for (KeyValue(k, v)) in t -> KeyValuePair(getKey k, v) |] :> System.Collections.IEnumerable + [| for KeyValue(k, v) in t -> KeyValuePair(getKey k, v) |] :> System.Collections.IEnumerable kvps.GetEnumerator() @@ -184,7 +184,7 @@ module ExtraTopLevelOperators = = let t = Dictionary comparer - for (k, v) in l do + for k, v in l do t.[makeSafeKey k] <- v DictImpl(t, makeSafeKey, getKey) @@ -195,7 +195,7 @@ module ExtraTopLevelOperators = // Wrap a StructBox around all keys in case the key type is itself a type using null as a representation let dictRefType (l: seq<'Key * 'T>) = - dictImpl RuntimeHelpers.StructBox<'Key>.Comparer (RuntimeHelpers.StructBox) (fun sb -> sb.Value) l + dictImpl RuntimeHelpers.StructBox<'Key>.Comparer RuntimeHelpers.StructBox (fun sb -> sb.Value) l [] let dict (keyValuePairs: seq<'Key * 'T>) : IDictionary<'Key, 'T> = @@ -465,7 +465,7 @@ type IProvidedNamespace = abstract GetTypes: unit -> Type array - abstract ResolveTypeName: typeName: string -> (Type | null) + abstract ResolveTypeName: typeName: string -> Type | null type ITypeProvider = inherit IDisposable diff --git a/src/FSharp.Core/fslib-extra-pervasives.fsi b/src/FSharp.Core/fslib-extra-pervasives.fsi index f74aefdc252..1e38995a2bd 100644 --- a/src/FSharp.Core/fslib-extra-pervasives.fsi +++ b/src/FSharp.Core/fslib-extra-pervasives.fsi @@ -508,7 +508,7 @@ namespace Microsoft.FSharp.Core.CompilerServices /// Resolver should return a type called name in namespace NamespaceName or null if the type is unknown. /// /// - abstract ResolveTypeName : typeName: string -> (Type|null) + abstract ResolveTypeName : typeName: string -> Type|null /// /// Represents an instantiation of a type provider component. diff --git a/src/FSharp.Core/local.fs b/src/FSharp.Core/local.fs index 1433e6dbcda..16654a06257 100644 --- a/src/FSharp.Core/local.fs +++ b/src/FSharp.Core/local.fs @@ -440,7 +440,7 @@ module internal List = | [] -> [] | [h] -> f h | _ -> - let cons = freshConsNoTail (Unchecked.defaultof<'U>) + let cons = freshConsNoTail Unchecked.defaultof<'U> collectToFreshConsTail f list cons cons.Tail @@ -464,7 +464,7 @@ module internal List = | _, [] -> [] | [], _ -> [] | _ -> - let cons = freshConsNoTail (Unchecked.defaultof<'T * 'U>) + let cons = freshConsNoTail Unchecked.defaultof<'T * 'U> allPairsToFreshConsTail xs ys cons cons.Tail @@ -1195,7 +1195,7 @@ module internal Seq = use e = source.GetEnumerator() if e.MoveNext() then let mutable res = e.Current - while (e.MoveNext()) do res <- e.Current + while e.MoveNext() do res <- e.Current ValueSome(res) else ValueNone diff --git a/src/FSharp.Core/mailbox.fs b/src/FSharp.Core/mailbox.fs index cc18804b5fb..99c3792d9ba 100644 --- a/src/FSharp.Core/mailbox.fs +++ b/src/FSharp.Core/mailbox.fs @@ -196,7 +196,7 @@ type Mailbox<'Msg>(cancellationSupported: bool, isThrowExceptionAfterDisposed: b savedCont <- None action true |> ignore) - member x.TryScan((f: 'Msg -> (Async<'T>) option), timeout) : Async<'T option> = + member x.TryScan(f: 'Msg -> Async<'T> option, timeout) : Async<'T option> = let rec scan timeoutAsync (timeoutCts: CancellationTokenSource) = async { match x.ScanArrivals f with @@ -263,7 +263,7 @@ type Mailbox<'Msg>(cancellationSupported: bool, isThrowExceptionAfterDisposed: b return Some res } - member x.Scan((f: 'Msg -> (Async<'T>) option), timeout) = + member x.Scan(f: 'Msg -> Async<'T> option, timeout) = async { let! resOpt = x.TryScan(f, timeout) @@ -419,7 +419,7 @@ type MailboxProcessor<'Msg>(body, isThrowExceptionAfterDisposed, ?cancellationTo member _.Post message = mailbox.Post message - member _.TryPostAndReply(buildMessage: (_ -> 'Msg), ?timeout) : 'Reply option = + member _.TryPostAndReply(buildMessage: _ -> 'Msg, ?timeout) : 'Reply option = let timeout = defaultArg timeout defaultTimeout use resultCell = new ResultCell<_>() @@ -506,10 +506,10 @@ type MailboxProcessor<'Msg>(body, isThrowExceptionAfterDisposed, ?cancellationTo member _.TryReceive(?timeout) = mailbox.TryReceive(timeout = defaultArg timeout defaultTimeout) - member _.Scan(scanner: 'Msg -> (Async<'T>) option, ?timeout) = + member _.Scan(scanner: 'Msg -> Async<'T> option, ?timeout) = mailbox.Scan(scanner, timeout = defaultArg timeout defaultTimeout) - member _.TryScan(scanner: 'Msg -> (Async<'T>) option, ?timeout) = + member _.TryScan(scanner: 'Msg -> Async<'T> option, ?timeout) = mailbox.TryScan(scanner, timeout = defaultArg timeout defaultTimeout) member x.Dispose() = diff --git a/src/FSharp.Core/mailbox.fsi b/src/FSharp.Core/mailbox.fsi index 740ab77080a..947d65c9c03 100644 --- a/src/FSharp.Core/mailbox.fsi +++ b/src/FSharp.Core/mailbox.fsi @@ -247,7 +247,7 @@ type MailboxProcessor<'Msg> = /// Thrown when the timeout is exceeded. /// /// - member Scan: scanner: ('Msg -> (Async<'T>) option) * ?timeout: int -> Async<'T> + member Scan: scanner: ('Msg -> Async<'T> option) * ?timeout: int -> Async<'T> /// Scans for a message by looking through messages in arrival order until scanner /// returns a Some value. Other messages remain in the queue. @@ -264,7 +264,7 @@ type MailboxProcessor<'Msg> = /// An asynchronous computation that scanner built off the read message. /// /// - member TryScan: scanner: ('Msg -> (Async<'T>) option) * ?timeout: int -> Async<'T option> + member TryScan: scanner: ('Msg -> Async<'T> option) * ?timeout: int -> Async<'T option> /// Starts the agent. /// diff --git a/src/FSharp.Core/map.fs b/src/FSharp.Core/map.fs index 36e3aa3bf72..434ccd08e76 100644 --- a/src/FSharp.Core/map.fs +++ b/src/FSharp.Core/map.fs @@ -119,19 +119,19 @@ module MapTree = let t2h = height t2 if t2h > t1h + tolerance then (* right is heavier than left *) - let t2' = asNode (t2) + let t2' = asNode t2 (* one of the nodes must have height > height t1 + 1 *) if height t2'.Left > t1h + 1 then (* balance left: combination *) - let t2l = asNode (t2'.Left) + let t2l = asNode t2'.Left mk (mk t1 k v t2l.Left) t2l.Key t2l.Value (mk t2l.Right t2'.Key t2'.Value t2'.Right) else (* rotate left *) mk (mk t1 k v t2'.Left) t2'.Key t2'.Value t2'.Right else if t1h > t2h + tolerance then (* left is heavier than right *) - let t1' = asNode (t1) + let t1' = asNode t1 (* one of the nodes must have height > height t2 + 1 *) if height t1'.Right > t2h + 1 then (* balance right: combination *) - let t1r = asNode (t1'.Right) + let t1r = asNode t1'.Right mk (mk t1'.Left t1'.Key t1'.Value t1r.Left) t1r.Key t1r.Value (mk t1r.Right k v t2) else mk t1'.Left t1'.Key t1'.Value (mk t1'.Right k v t2) @@ -531,7 +531,7 @@ module MapTree = let rec mkFromEnumerator comparer acc (e: IEnumerator<_>) = if e.MoveNext() then - let (x, y) = e.Current + let x, y = e.Current mkFromEnumerator comparer (add comparer x y acc) e else acc @@ -539,7 +539,7 @@ module MapTree = let ofArray comparer (arr: ('Key * 'Value) array) = let mutable res = empty - for (x, y) in arr do + for x, y in arr do res <- add comparer x y res res @@ -845,7 +845,7 @@ type Map<[] 'Key, [] 'Key, [] 'Key, [> with - member _.Add(_) = + member _.Add _ = raise (NotSupportedException(SR.GetString(SR.mapCannotBeMutated))) member _.Clear() = raise (NotSupportedException(SR.GetString(SR.mapCannotBeMutated))) - member _.Remove(_) = + member _.Remove _ = raise (NotSupportedException(SR.GetString(SR.mapCannotBeMutated))) member m.Contains x = @@ -1045,13 +1045,13 @@ and [ and KeyCollection<'Key, 'Value when 'Key: comparison>(parent: Map<'Key, 'Value>) = interface ICollection<'Key> with - member _.Add(_) = + member _.Add _ = raise (NotSupportedException(SR.GetString(SR.mapCannotBeMutated))) member _.Clear() = raise (NotSupportedException(SR.GetString(SR.mapCannotBeMutated))) - member _.Remove(_) = + member _.Remove _ = raise (NotSupportedException(SR.GetString(SR.mapCannotBeMutated))) member _.Contains x = @@ -1096,13 +1096,13 @@ and KeyCollection<'Key, 'Value when 'Key: comparison>(parent: Map<'Key, 'Value>) and ValueCollection<'Key, 'Value when 'Key: comparison>(parent: Map<'Key, 'Value>) = interface ICollection<'Value> with - member _.Add(_) = + member _.Add _ = raise (NotSupportedException(SR.GetString(SR.mapCannotBeMutated))) member _.Clear() = raise (NotSupportedException(SR.GetString(SR.mapCannotBeMutated))) - member _.Remove(_) = + member _.Remove _ = raise (NotSupportedException(SR.GetString(SR.mapCannotBeMutated))) member _.Contains x = diff --git a/src/FSharp.Core/prim-types.fs b/src/FSharp.Core/prim-types.fs index fe725dd4c67..a885a666498 100644 --- a/src/FSharp.Core/prim-types.fs +++ b/src/FSharp.Core/prim-types.fs @@ -924,7 +924,7 @@ namespace Microsoft.FSharp.Core val mutable nodeCount : int member x.Fresh() = - if (System.Threading.Interlocked.CompareExchange(&(x.nodeCount), sz, 0) = 0) then + if (System.Threading.Interlocked.CompareExchange(&x.nodeCount, sz, 0) = 0) then x else CountLimitedHasherPER(sz) @@ -1017,7 +1017,7 @@ namespace Microsoft.FSharp.Core let rec GenericHashParamObj (iec : IEqualityComparer) (x: objnull) : int = match x with | null -> 0 - | (:? Array as a) -> + | :? Array as a -> match a with | :? (obj array) as oa -> GenericHashObjArray iec oa | :? (byte array) as ba -> GenericHashByteArray ba @@ -1085,17 +1085,17 @@ namespace Microsoft.FSharp.Core | _,null -> 1 // Use Ordinal comparison for strings - | (:? string as x),(:? string as y) -> + | :? string as x,(:? string as y) -> String.CompareOrdinal(x, y) // Permit structural comparison on arrays - | (:? Array as arr1),_ -> + | :? Array as arr1,_ -> match arr1,yobj with // Fast path - | (:? (obj array) as arr1), (:? (obj array) as arr2) -> + | :? (obj array) as arr1, (:? (obj array) as arr2) -> GenericComparisonObjArrayWithComparer comp arr1 arr2 // Fast path - | (:? (byte array) as arr1), (:? (byte array) as arr2) -> + | :? (byte array) as arr1, (:? (byte array) as arr2) -> GenericComparisonByteArray arr1 arr2 | _, (:? Array as arr2) -> GenericComparisonArbArrayWithComparer comp arr1 arr2 @@ -1103,26 +1103,26 @@ namespace Microsoft.FSharp.Core FailGenericComparison xobj // Check for IStructuralComparable - | (:? IStructuralComparable as x),_ -> + | :? IStructuralComparable as x,_ -> x.CompareTo(yobj,comp) // Check for IComparable - | (:? IComparable as x),_ -> + | :? IComparable as x,_ -> if comp.ThrowsOnPER then match xobj,yobj with - | (:? float as x),(:? float as y) -> + | :? float as x,(:? float as y) -> if (Double.IsNaN x || Double.IsNaN y) then raise NaNException - | (:? float32 as x),(:? float32 as y) -> + | :? float32 as x,(:? float32 as y) -> if (Single.IsNaN x || Single.IsNaN y) then raise NaNException | _ -> () x.CompareTo(yobj) - | (:? nativeint as x),(:? nativeint as y) -> + | :? nativeint as x,(:? nativeint as y) -> (# "cgt" x y : int #) - (# "clt" x y : int #) - | (:? unativeint as x),(:? unativeint as y) -> + | :? unativeint as x,(:? unativeint as y) -> (# "cgt.un" x y : int #) - (# "clt.un" x y : int #) | _,(:? IStructuralComparable as yc) -> @@ -1149,7 +1149,7 @@ namespace Microsoft.FSharp.Core if c <> 0 then c else let rec check i = if i >=. lenx then 0 else - let c = GenericCompare comp ((x.GetValue(i +. basex)), (y.GetValue(i +. basey))) + let c = GenericCompare comp (x.GetValue(i +. basex), y.GetValue(i +. basey)) if c <> 0 then c else check (i +. 1L) check 0L elif x.Rank = 2 && y.Rank = 2 then @@ -1172,7 +1172,8 @@ namespace Microsoft.FSharp.Core let rec check0 i = let rec check1 j = if j >=. lenx1 then 0 else - let c = GenericCompare comp ((x.GetValue(i +. basex0,j +. basex1)), (y.GetValue(i +. basey0,j +. basey1))) + let c = GenericCompare comp (x.GetValue(i +. basex0,j +. basex1), + y.GetValue(i +. basey0,j +. basey1)) if c <> 0 then c else check1 (j +. 1L) if i >=. lenx0 then 0 else let c = check1 0L @@ -1199,7 +1200,7 @@ namespace Microsoft.FSharp.Core set idxs k (baseIdx +. i) let c = if k = ndims - 1 - then GenericCompare comp ((x.GetValue(idxs)), (y.GetValue(idxs))) + then GenericCompare comp (x.GetValue(idxs), y.GetValue(idxs)) else check (k+1) if c <> 0 then c else checkN k baseIdx (i +. 1L) lim @@ -1577,33 +1578,33 @@ namespace Microsoft.FSharp.Core // // If "er" is true the "iec" is fsEqualityComparerUnlimitedHashingER // If "er" is false the "iec" is fsEqualityComparerUnlimitedHashingPER - let rec GenericEqualityObj (er:bool) (iec:IEqualityComparer) ((xobj:objnull),(yobj:objnull)) : bool = + let rec GenericEqualityObj (er:bool) (iec:IEqualityComparer) (xobj:objnull, yobj:objnull) : bool = (*if objEq xobj yobj then true else *) match xobj,yobj with | null,null -> true | null,_ -> false | _,null -> false - | (:? string as xs),(:? string as ys) -> String.Equals(xs,ys) + | :? string as xs,(:? string as ys) -> String.Equals(xs,ys) // Permit structural equality on arrays - | (:? Array as arr1),_ -> + | :? Array as arr1,_ -> match arr1,yobj with // Fast path - | (:? (obj array) as arr1), (:? (obj array) as arr2) -> GenericEqualityObjArray er iec arr1 arr2 + | :? (obj array) as arr1, (:? (obj array) as arr2) -> GenericEqualityObjArray er iec arr1 arr2 // Fast path - | (:? (byte array) as arr1), (:? (byte array) as arr2) -> GenericEqualityByteArray arr1 arr2 - | (:? (int32 array) as arr1), (:? (int32 array) as arr2) -> GenericEqualityInt32Array arr1 arr2 - | (:? (int64 array) as arr1), (:? (int64 array) as arr2) -> GenericEqualityInt64Array arr1 arr2 - | (:? (char array) as arr1), (:? (char array) as arr2) -> GenericEqualityCharArray arr1 arr2 - | (:? (float32 array) as arr1), (:? (float32 array) as arr2) -> GenericEqualitySingleArray er arr1 arr2 - | (:? (float array) as arr1), (:? (float array) as arr2) -> GenericEqualityDoubleArray er arr1 arr2 + | :? (byte array) as arr1, (:? (byte array) as arr2) -> GenericEqualityByteArray arr1 arr2 + | :? (int32 array) as arr1, (:? (int32 array) as arr2) -> GenericEqualityInt32Array arr1 arr2 + | :? (int64 array) as arr1, (:? (int64 array) as arr2) -> GenericEqualityInt64Array arr1 arr2 + | :? (char array) as arr1, (:? (char array) as arr2) -> GenericEqualityCharArray arr1 arr2 + | :? (float32 array) as arr1, (:? (float32 array) as arr2) -> GenericEqualitySingleArray er arr1 arr2 + | :? (float array) as arr1, (:? (float array) as arr2) -> GenericEqualityDoubleArray er arr1 arr2 | _, (:? Array as arr2) -> GenericEqualityArbArray er iec arr1 arr2 | _ -> xobj.Equals(yobj) - | (:? IStructuralEquatable as x1),_ -> x1.Equals(yobj,iec) + | :? IStructuralEquatable as x1,_ -> x1.Equals(yobj,iec) // Ensure ER NaN semantics on recursive calls - | (:? float as f1), (:? float as f2) -> + | :? float as f1, (:? float as f2) -> if er && (not (# "ceq" f1 f1 : bool #)) && (not (# "ceq" f2 f2 : bool #)) then true // NAN with ER semantics else (# "ceq" f1 f2 : bool #) // PER semantics - | (:? float32 as f1), (:? float32 as f2) -> + | :? float32 as f1, (:? float32 as f2) -> if er && (not (# "ceq" f1 f1 : bool #)) && (not (# "ceq" f2 f2 : bool #)) then true // NAN with ER semantics else (# "ceq" f1 f2 : bool #) // PER semantics | _ -> xobj.Equals(yobj) @@ -1619,7 +1620,8 @@ namespace Microsoft.FSharp.Core let basex = int64 (x.GetLowerBound(0)) let basey = int64 (y.GetLowerBound(0)) (int64Eq basex basey) && - let rec check i = (i >=. lenx) || (GenericEqualityObj er iec ((x.GetValue(basex +. i)),(y.GetValue(basey +. i))) && check (i +. 1L)) + let rec check i = (i >=. lenx) || (GenericEqualityObj er iec (x.GetValue(basex +. i), + y.GetValue(basey +. i)) && check (i +. 1L)) check 0L elif x.Rank = 2 && y.Rank = 2 then // check lengths @@ -1637,7 +1639,9 @@ namespace Microsoft.FSharp.Core (int64Eq basex1 basey1) && // check contents let rec check0 i = - let rec check1 j = (j >=. lenx1) || (GenericEqualityObj er iec ((x.GetValue(basex0 +. i,basex1 +. j)),(y.GetValue(basey0 +. i,basey1 +. j))) && check1 (j +. 1L)) + let rec check1 j = (j >=. lenx1) || (GenericEqualityObj er iec ( + x.GetValue(basex0 +. i,basex1 +. j), + y.GetValue(basey0 +. i,basey1 +. j)) && check1 (j +. 1L)) (i >=. lenx0) || (check1 0L && check0 (i +. 1L)) check0 0L else @@ -1656,7 +1660,7 @@ namespace Microsoft.FSharp.Core (i >=. lim) || (set idxs k (baseIdx +. i); (if k = ndims - 1 - then GenericEqualityObj er iec ((x.GetValue(idxs)),(y.GetValue(idxs))) + then GenericEqualityObj er iec (x.GetValue(idxs), y.GetValue(idxs)) else check (k+1)) && checkN k baseIdx (i +. 1L) lim) and check k = @@ -1774,14 +1778,14 @@ namespace Microsoft.FSharp.Core | null, null -> true | null, _ -> false | _, null -> false - | (:? (objnull array) as arr1), (:? (objnull array) as arr2) -> GenericEqualityObjArray er iec arr1 arr2 - | (:? (byte array) as arr1), (:? (byte array) as arr2) -> GenericEqualityByteArray arr1 arr2 - | (:? (int32 array) as arr1), (:? (int32 array) as arr2) -> GenericEqualityInt32Array arr1 arr2 - | (:? (int64 array) as arr1), (:? (int64 array) as arr2) -> GenericEqualityInt64Array arr1 arr2 - | (:? (char array) as arr1), (:? (char array) as arr2) -> GenericEqualityCharArray arr1 arr2 - | (:? (float32 array) as arr1), (:? (float32 array) as arr2) -> GenericEqualitySingleArray er arr1 arr2 - | (:? (float array) as arr1), (:? (float array) as arr2) -> GenericEqualityDoubleArray er arr1 arr2 - | (:? Array as arr1), (:? Array as arr2) -> GenericEqualityArbArray er iec arr1 arr2 + | :? (objnull array) as arr1, (:? (objnull array) as arr2) -> GenericEqualityObjArray er iec arr1 arr2 + | :? (byte array) as arr1, (:? (byte array) as arr2) -> GenericEqualityByteArray arr1 arr2 + | :? (int32 array) as arr1, (:? (int32 array) as arr2) -> GenericEqualityInt32Array arr1 arr2 + | :? (int64 array) as arr1, (:? (int64 array) as arr2) -> GenericEqualityInt64Array arr1 arr2 + | :? (char array) as arr1, (:? (char array) as arr2) -> GenericEqualityCharArray arr1 arr2 + | :? (float32 array) as arr1, (:? (float32 array) as arr2) -> GenericEqualitySingleArray er arr1 arr2 + | :? (float array) as arr1, (:? (float array) as arr2) -> GenericEqualityDoubleArray er arr1 arr2 + | :? Array as arr1, (:? Array as arr2) -> GenericEqualityArbArray er iec arr1 arr2 | _ -> raise (Exception "invalid logic - expected array") let getHashCode (iec, xobj: objnull) = @@ -1805,7 +1809,7 @@ namespace Microsoft.FSharp.Core | null, null -> true | null, _ -> false | _, null -> false - | (:? IStructuralEquatable as x1), yobj -> x1.Equals (yobj, comparer) + | :? IStructuralEquatable as x1, yobj -> x1.Equals (yobj, comparer) | _ -> raise (Exception "invalid logic - expected IStructuralEquatable") member _.GetHashCode x = @@ -2362,7 +2366,7 @@ namespace Microsoft.FSharp.Core // known to the F# compiler which are then often optimized for the particular nominal type involved. when 'T : 'T = MakeGenericEqualityComparer<'T>() - let inline FastLimitedGenericEqualityComparer<'T>(limit) = MakeGenericLimitedEqualityComparer<'T>(limit) + let inline FastLimitedGenericEqualityComparer<'T> limit = MakeGenericLimitedEqualityComparer<'T>(limit) let inline MakeGenericComparer<'T>() = { new IComparer<'T> with @@ -2767,12 +2771,12 @@ namespace Microsoft.FSharp.Core ret <- mi ret - let UnaryDynamicImpl nm : ('T -> 'U) = + let UnaryDynamicImpl nm : 'T -> 'U = let aty = typeof<'T> let minfo = aty.GetSingleStaticMethodByTypes(nm, [| aty |]) (fun x -> unboxPrim<_>(minfo.Invoke(null,[| box x|]))) - let BinaryDynamicImpl nm : ('T -> 'U -> 'V) = + let BinaryDynamicImpl nm : 'T -> 'U -> 'V = let aty = typeof<'T> let bty = typeof<'U> let minfo = aty.GetSingleStaticMethodByTypes(nm, [| aty; bty |]) @@ -3770,7 +3774,7 @@ namespace Microsoft.FSharp.Core [] type FSharpFunc<'T,'U,'V> [] () = - inherit FSharpFunc<'T,('U -> 'V)>() + inherit FSharpFunc<'T, 'U -> 'V>() abstract Invoke : 'T * 'U -> 'V override f.Invoke(t) = (fun u -> f.Invoke(t,u)) static member Adapt(func : 'T -> 'U -> 'V) = @@ -3784,7 +3788,7 @@ namespace Microsoft.FSharp.Core [] type FSharpFunc<'T,'U,'V,'W> [] () = - inherit FSharpFunc<'T,('U -> 'V -> 'W)>() + inherit FSharpFunc<'T, 'U -> 'V -> 'W>() abstract Invoke : 'T * 'U * 'V -> 'W override f.Invoke(t) = (fun u v -> f.Invoke(t,u,v)) static member Adapt(func : 'T -> 'U -> 'V -> 'W) = @@ -3800,11 +3804,11 @@ namespace Microsoft.FSharp.Core | _ -> { new FSharpFunc<'T,'U,'V,'W>() with - member _.Invoke(t,u,v) = (retype func : FSharpFunc<'T,('U -> 'V -> 'W)>).Invoke(t) u v } + member _.Invoke(t,u,v) = (retype func : FSharpFunc<'T, 'U -> 'V -> 'W>).Invoke(t) u v } [] type FSharpFunc<'T,'U,'V,'W,'X> [] () = - inherit FSharpFunc<'T,('U -> 'V -> 'W -> 'X)>() + inherit FSharpFunc<'T, 'U -> 'V -> 'W -> 'X>() abstract Invoke : 'T * 'U * 'V * 'W -> 'X static member Adapt(func : 'T -> 'U -> 'V -> 'W -> 'X) = match box func with @@ -3817,19 +3821,19 @@ namespace Microsoft.FSharp.Core member _.Invoke(t,u,v,w) = f.Invoke(t,u,v).Invoke(w) } // Does it take two arguments without side effect? - | :? FSharpFunc<'T,'U,('V -> 'W -> 'X)> as f -> + | :? FSharpFunc<'T,'U, 'V -> 'W -> 'X> as f -> { new FSharpFunc<'T,'U,'V,'W,'X>() with member _.Invoke(t,u,v,w) = f.Invoke(t,u) v w } | _ -> { new FSharpFunc<'T,'U,'V,'W,'X>() with - member _.Invoke(t,u,v,w) = ((retype func : FSharpFunc<'T,('U -> 'V -> 'W -> 'X)>).Invoke(t)) u v w } + member _.Invoke(t,u,v,w) = (retype func : FSharpFunc<'T, 'U -> 'V -> 'W -> 'X>).Invoke(t) u v w } override f.Invoke(t) = (fun u v w -> f.Invoke(t,u,v,w)) [] type FSharpFunc<'T,'U,'V,'W,'X,'Y> [] () = - inherit FSharpFunc<'T,('U -> 'V -> 'W -> 'X -> 'Y)>() + inherit FSharpFunc<'T, 'U -> 'V -> 'W -> 'X -> 'Y>() abstract Invoke : 'T * 'U * 'V * 'W * 'X -> 'Y @@ -3847,67 +3851,68 @@ namespace Microsoft.FSharp.Core member ff.Invoke(t,u,v,w,x) = f.Invoke(t,u,v,w).Invoke(x) } // Does it take three arguments without side effect? - | :? FSharpFunc<'T,'U,'V,('W -> 'X -> 'Y)> as f -> + | :? FSharpFunc<'T,'U,'V, 'W -> 'X -> 'Y> as f -> { new FSharpFunc<'T,'U,'V,'W,'X,'Y>() with member ff.Invoke(t,u,v,w,x) = f.Invoke(t,u,v) w x } // Does it take two arguments without side effect? - | :? FSharpFunc<'T,'U,('V -> 'W -> 'X -> 'Y)> as f -> + | :? FSharpFunc<'T,'U, 'V -> 'W -> 'X -> 'Y> as f -> { new FSharpFunc<'T,'U,'V,'W,'X,'Y>() with member ff.Invoke(t,u,v,w,x) = f.Invoke(t,u) v w x } | _ -> { new FSharpFunc<'T,'U,'V,'W,'X,'Y>() with - member ff.Invoke(t,u,v,w,x) = ((retype func : FSharpFunc<'T,('U -> 'V -> 'W -> 'X -> 'Y)>).Invoke(t)) u v w x } + member ff.Invoke(t,u,v,w,x) = + (retype func : FSharpFunc<'T, 'U -> 'V -> 'W -> 'X -> 'Y>).Invoke(t) u v w x } - let inline invokeFast2((f1 : FSharpFunc<'T,('U -> 'V)>), t,u) = + let inline invokeFast2(f1 : FSharpFunc<'T, 'U -> 'V>, t,u) = match f1 with | :? FSharpFunc<'T,'U,'V> as f2 -> f2.Invoke(t,u) - | _ -> (f1.Invoke(t)) u + | _ -> f1.Invoke(t) u - let inline invokeFast3((f1 : FSharpFunc<'T,('U -> 'V -> 'W)>), t,u,v) = + let inline invokeFast3(f1 : FSharpFunc<'T, 'U -> 'V -> 'W>, t,u,v) = match f1 with | :? FSharpFunc<'T,'U,'V,'W> as f3 -> f3.Invoke(t,u,v) - | :? FSharpFunc<'T,'U,('V -> 'W)> as f2 -> (f2.Invoke(t,u)) v - | _ -> (f1.Invoke(t)) u v + | :? FSharpFunc<'T,'U, 'V -> 'W> as f2 -> f2.Invoke(t,u) v + | _ -> f1.Invoke(t) u v - let inline invokeFast4((f1 : FSharpFunc<'T,('U -> 'V -> 'W -> 'X)>), t,u,v,w) = + let inline invokeFast4(f1 : FSharpFunc<'T, 'U -> 'V -> 'W -> 'X>, t,u,v,w) = match f1 with | :? FSharpFunc<'T,'U,'V,'W,'X> as f4 -> f4.Invoke(t,u,v,w) - | :? FSharpFunc<'T,'U,'V,('W -> 'X)> as f3 -> (f3.Invoke(t,u,v)) w - | :? FSharpFunc<'T,'U,('V -> 'W -> 'X)> as f2 -> (f2.Invoke(t,u)) v w - | _ -> (f1.Invoke(t)) u v w + | :? FSharpFunc<'T,'U,'V, 'W -> 'X> as f3 -> f3.Invoke(t,u,v) w + | :? FSharpFunc<'T,'U, 'V -> 'W -> 'X> as f2 -> f2.Invoke(t,u) v w + | _ -> f1.Invoke(t) u v w - let inline invokeFast5((f1 : FSharpFunc<'T,('U -> 'V -> 'W -> 'X -> 'Y)>), t,u,v,w,x) = + let inline invokeFast5(f1 : FSharpFunc<'T, 'U -> 'V -> 'W -> 'X -> 'Y>, t,u,v,w,x) = match f1 with | :? FSharpFunc<'T,'U,'V,'W,'X,'Y> as f5 -> f5.Invoke(t,u,v,w,x) - | :? FSharpFunc<'T,'U,'V,'W,('X -> 'Y)> as f4 -> (f4.Invoke(t,u,v,w)) x - | :? FSharpFunc<'T,'U,'V,('W -> 'X -> 'Y)> as f3 -> (f3.Invoke(t,u,v)) w x - | :? FSharpFunc<'T,'U,('V -> 'W -> 'X -> 'Y)> as f2 -> (f2.Invoke(t,u)) v w x - | _ -> (f1.Invoke(t)) u v w x + | :? FSharpFunc<'T,'U,'V,'W, 'X -> 'Y> as f4 -> f4.Invoke(t,u,v,w) x + | :? FSharpFunc<'T,'U,'V, 'W -> 'X -> 'Y> as f3 -> f3.Invoke(t,u,v) w x + | :? FSharpFunc<'T,'U, 'V -> 'W -> 'X -> 'Y> as f2 -> f2.Invoke(t,u) v w x + | _ -> f1.Invoke(t) u v w x type FSharpFunc<'T,'Res> with // Note: this is not made public in the signature, because of conflicts with the Converter overload. // The method remains in case someone is calling it via reflection. - static member op_Implicit(converter : Func<_,_>) : ('T -> 'Res) = + static member op_Implicit(converter : Func<_,_>) : 'T -> 'Res = (fun t -> converter.Invoke(t)) // Note: this is not made public in the signature, because of conflicts with the Converter overload. // The method remains in case someone is calling it via reflection. - static member op_Implicit(func : ('T -> 'Res) ) = + static member op_Implicit(func : 'T -> 'Res) = new Func<'T,'Res>(func) - static member op_Implicit(f : Converter<_,_>) : ('T -> 'Res) = + static member op_Implicit(f : Converter<_,_>) : 'T -> 'Res = (fun t -> f.Invoke(t)) - static member op_Implicit (func : ('T -> 'Res) ) = + static member op_Implicit (func : 'T -> 'Res) = new Converter<'T,'Res>(func) - static member FromConverter (converter: Converter<_,_>) : ('T -> 'Res) = + static member FromConverter (converter: Converter<_,_>) : 'T -> 'Res = (fun t -> converter.Invoke(t)) - static member ToConverter (func: ('T -> 'Res) ) = + static member ToConverter (func: 'T -> 'Res) = new Converter<'T,'Res>(func) [] @@ -4031,9 +4036,9 @@ namespace Microsoft.FSharp.Core [] static member None : 'T option = None - static member Some (value) : 'T option = Some(value) + static member Some value: 'T option = Some(value) - static member op_Implicit (value) : 'T option = Some(value) + static member op_Implicit value: 'T option = Some(value) member private x.DebugDisplay = match x with @@ -4068,7 +4073,7 @@ namespace Microsoft.FSharp.Core [] static member None : 'T voption = ValueNone - static member Some (value) : 'T voption = ValueSome(value) + static member Some value: 'T voption = ValueSome(value) [] member x.IsNone = match x with ValueNone -> true | _ -> false @@ -4076,7 +4081,7 @@ namespace Microsoft.FSharp.Core [] member x.IsSome = match x with ValueSome _ -> true | _ -> false - static member op_Implicit (value) : 'T voption = ValueSome(value) + static member op_Implicit value: 'T voption = ValueSome(value) member private x.DebugDisplay = match x with @@ -4272,7 +4277,7 @@ namespace Microsoft.FSharp.Collections match l with | [] -> raise (ArgumentException(SR.GetString(SR.indexOutOfBounds),"n")) | h :: t -> - if n < 0 then raise (ArgumentException((SR.GetString(SR.inputMustBeNonNegative)),"n")) + if n < 0 then raise (ArgumentException(SR.GetString(SR.inputMustBeNonNegative),"n")) elif n = 0 then h else nth t (n - 1) @@ -4331,7 +4336,7 @@ namespace Microsoft.FSharp.Collections | [] -> true | _ -> false - member l.Item with get(index) = PrivateListHelpers.nth l index + member l.Item with get index = PrivateListHelpers.nth l index [] static member Empty : 'T list = [] @@ -4370,7 +4375,7 @@ namespace Microsoft.FSharp.Collections member l.Count = l.Length interface IReadOnlyList<'T> with - member l.Item with get(index) = l.[index] + member l.Item with get index = l.[index] type seq<'T> = IEnumerable<'T> @@ -4812,7 +4817,7 @@ namespace Microsoft.FSharp.Core let (@) list1 list2 = match list1 with | [] -> list2 - | (h :: t) -> + | h :: t -> match list2 with | [] -> list1 | _ -> @@ -5491,7 +5496,7 @@ namespace Microsoft.FSharp.Core raise (Exception "may not call directly, should always be optimized away") [] - let methodhandleof (_call: ('T -> 'TResult)) : RuntimeMethodHandle = + let methodhandleof (_call: 'T -> 'TResult) : RuntimeMethodHandle = raise (Exception "may not call directly, should always be optimized away") [] @@ -6817,7 +6822,7 @@ namespace Microsoft.FSharp.Core when ^T : float32 = Math.Pow(toFloat (retype x), toFloat(retype y)) |> toFloat32 type AbsDynamicImplTable<'T>() = - static let result : ('T -> 'T) = + static let result : 'T -> 'T = let ty = typeof<'T> if Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:sbyte) -> absImpl x) elif Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:int16) -> absImpl x) @@ -6828,82 +6833,82 @@ namespace Microsoft.FSharp.Core elif Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float32) -> absImpl x) elif Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:decimal) -> absImpl x) else UnaryDynamicImpl "Abs" - static member Result : ('T -> 'T) = result + static member Result : 'T -> 'T = result type AcosDynamicImplTable<'T>() = - static let result : ('T -> 'T) = + static let result : 'T -> 'T = let ty = typeof<'T> if Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float) -> acosImpl x) elif Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float32) -> acosImpl x) else UnaryDynamicImpl "Acos" - static member Result : ('T -> 'T) = result + static member Result : 'T -> 'T = result type AsinDynamicImplTable<'T>() = - static let result : ('T -> 'T) = + static let result : 'T -> 'T = let ty = typeof<'T> if Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float) -> asinImpl x) elif Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float32) -> asinImpl x) else UnaryDynamicImpl "Asin" - static member Result : ('T -> 'T) = result + static member Result : 'T -> 'T = result type AtanDynamicImplTable<'T>() = - static let result : ('T -> 'T) = + static let result : 'T -> 'T = let ty = typeof<'T> if Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float) -> atanImpl x) elif Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float32) -> atanImpl x) else UnaryDynamicImpl "Atan" - static member Result : ('T -> 'T) = result + static member Result : 'T -> 'T = result type Atan2DynamicImplTable<'T,'U>() = - static let result : ('T -> 'T -> 'U) = + static let result : 'T -> 'T -> 'U = let ty = typeof<'T> if Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float) (y:float) -> atan2Impl x y) elif Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float32) (y:float32) -> atan2Impl x y) else BinaryDynamicImpl "Atan2" - static member Result : ('T -> 'T -> 'U) = result + static member Result : 'T -> 'T -> 'U = result type CeilingDynamicImplTable<'T>() = - static let result : ('T -> 'T) = + static let result : 'T -> 'T = let ty = typeof<'T> if Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float) -> ceilImpl x) elif Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float32) -> ceilImpl x) else UnaryDynamicImpl "Ceiling" - static member Result : ('T -> 'T) = result + static member Result : 'T -> 'T = result type ExpDynamicImplTable<'T>() = - static let result : ('T -> 'T) = + static let result : 'T -> 'T = let ty = typeof<'T> if Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float) -> expImpl x) elif Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float32) -> expImpl x) else UnaryDynamicImpl "Exp" - static member Result : ('T -> 'T) = result + static member Result : 'T -> 'T = result type FloorDynamicImplTable<'T>() = - static let result : ('T -> 'T) = + static let result : 'T -> 'T = let ty = typeof<'T> if Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float) -> floorImpl x) elif Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float32) -> floorImpl x) else UnaryDynamicImpl "Floor" - static member Result : ('T -> 'T) = result + static member Result : 'T -> 'T = result type TruncateDynamicImplTable<'T>() = - static let result : ('T -> 'T) = + static let result : 'T -> 'T = let ty = typeof<'T> if Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float) -> truncateImpl x) elif Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float32) -> truncateImpl x) else UnaryDynamicImpl "Truncate" - static member Result : ('T -> 'T) = result + static member Result : 'T -> 'T = result type RoundDynamicImplTable<'T>() = - static let result : ('T -> 'T) = + static let result : 'T -> 'T = let ty = typeof<'T> if Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float) -> roundImpl x) elif Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float32) -> roundImpl x) else UnaryDynamicImpl "Round" - static member Result : ('T -> 'T) = result + static member Result : 'T -> 'T = result type SignDynamicImplTable<'T>() = - static let result : ('T -> int) = + static let result : 'T -> int = let ty = typeof<'T> if Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float) -> signImpl x) elif Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float32) -> signImpl x) @@ -6914,87 +6919,87 @@ namespace Microsoft.FSharp.Core elif Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:int64) -> signImpl x) elif Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:sbyte) -> signImpl x) else UnaryDynamicImpl "Sign" - static member Result : ('T -> int) = result + static member Result : 'T -> int = result type LogDynamicImplTable<'T>() = - static let result : ('T -> 'T) = + static let result : 'T -> 'T = let ty = typeof<'T> if Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float) -> logImpl x) elif Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float32) -> logImpl x) else UnaryDynamicImpl "Log" - static member Result : ('T -> 'T) = result + static member Result : 'T -> 'T = result type Log10DynamicImplTable<'T>() = - static let result : ('T -> 'T) = + static let result : 'T -> 'T = let ty = typeof<'T> if Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float) -> log10Impl x) elif Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float32) -> log10Impl x) else UnaryDynamicImpl "Log10" - static member Result : ('T -> 'T) = result + static member Result : 'T -> 'T = result type SqrtDynamicImplTable<'T,'U>() = - static let result : ('T -> 'U) = + static let result : 'T -> 'U = let ty = typeof<'T> if Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float) -> sqrtImpl x) elif Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float32) -> sqrtImpl x) else UnaryDynamicImpl "Sqrt" - static member Result : ('T -> 'U) = result + static member Result : 'T -> 'U = result type CosDynamicImplTable<'T>() = - static let result : ('T -> 'T) = + static let result : 'T -> 'T = let ty = typeof<'T> if Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float) -> cosImpl x) elif Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float32) -> cosImpl x) else UnaryDynamicImpl "Cos" - static member Result : ('T -> 'T) = result + static member Result : 'T -> 'T = result type CoshDynamicImplTable<'T>() = - static let result : ('T -> 'T) = + static let result : 'T -> 'T = let ty = typeof<'T> if Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float) -> coshImpl x) elif Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float32) -> coshImpl x) else UnaryDynamicImpl "Cosh" - static member Result : ('T -> 'T) = result + static member Result : 'T -> 'T = result type SinDynamicImplTable<'T>() = - static let result : ('T -> 'T) = + static let result : 'T -> 'T = let ty = typeof<'T> if Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float) -> sinImpl x) elif Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float32) -> sinImpl x) else UnaryDynamicImpl "Sin" - static member Result : ('T -> 'T) = result + static member Result : 'T -> 'T = result type SinhDynamicImplTable<'T>() = - static let result : ('T -> 'T) = + static let result : 'T -> 'T = let ty = typeof<'T> if Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float) -> sinhImpl x) elif Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float32) -> sinhImpl x) else UnaryDynamicImpl "Sinh" - static member Result : ('T -> 'T) = result + static member Result : 'T -> 'T = result type TanDynamicImplTable<'T>() = - static let result : ('T -> 'T) = + static let result : 'T -> 'T = let ty = typeof<'T> if Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float) -> tanImpl x) elif Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float32) -> tanImpl x) else UnaryDynamicImpl "Tan" - static member Result : ('T -> 'T) = result + static member Result : 'T -> 'T = result type TanhDynamicImplTable<'T>() = - static let result : ('T -> 'T) = + static let result : 'T -> 'T = let ty = typeof<'T> if Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float) -> tanhImpl x) elif Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float32) -> tanhImpl x) else UnaryDynamicImpl "Tanh" - static member Result : ('T -> 'T) = result + static member Result : 'T -> 'T = result type PowDynamicImplTable<'T,'U>() = - static let result : ('T -> 'U -> 'T) = + static let result : 'T -> 'U -> 'T = let ty = typeof<'T> if Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float) (y:float) -> powImpl x y) elif Type.op_Equality(ty, typeof) then unboxPrim<_>(fun (x:float32) (y:float32) -> powImpl x y) else BinaryDynamicImpl "Pow" - static member Result : ('T -> 'U -> 'T) = result + static member Result : 'T -> 'U -> 'T = result let AbsDynamic x = AbsDynamicImplTable<_>.Result x @@ -7177,8 +7182,8 @@ namespace Microsoft.FSharp.Core when ^T : ^T = powImpl x y let inline gpown (x: ^T) n = - let v = PowGeneric (GenericOne< (^T) >, Checked.( * ), x,n) - if n < 0 then GenericOne< (^T) > / v + let v = PowGeneric (GenericOne< ^T >, Checked.( * ), x,n) + if n < 0 then GenericOne< ^T > / v else v [] diff --git a/src/FSharp.Core/prim-types.fsi b/src/FSharp.Core/prim-types.fsi index 04a38847052..d29c4067c36 100644 --- a/src/FSharp.Core/prim-types.fsi +++ b/src/FSharp.Core/prim-types.fsi @@ -2152,7 +2152,7 @@ namespace Microsoft.FSharp.Core /// The fifth arg. /// /// The function result. - static member InvokeFast: func: FSharpFunc<'T,('U -> 'V -> 'W -> 'X -> 'Y)> * arg1: 'T * arg2: 'U * arg3: 'V * arg4: 'W * arg5: 'X -> 'Y + static member InvokeFast: func: FSharpFunc<'T, 'U -> 'V -> 'W -> 'X -> 'Y> * arg1: 'T * arg2: 'U * arg3: 'V * arg4: 'W * arg5: 'X -> 'Y /// Invoke an F# first class function value with four curried arguments. In some cases this /// will result in a more efficient application than applying the arguments successively. @@ -2164,7 +2164,7 @@ namespace Microsoft.FSharp.Core /// The fourth arg. /// /// The function result. - static member InvokeFast: func: FSharpFunc<'T,('U -> 'V -> 'W -> 'X)> * arg1: 'T * arg2: 'U * arg3: 'V * arg4: 'W -> 'X + static member InvokeFast: func: FSharpFunc<'T, 'U -> 'V -> 'W -> 'X> * arg1: 'T * arg2: 'U * arg3: 'V * arg4: 'W -> 'X /// Invoke an F# first class function value with three curried arguments. In some cases this /// will result in a more efficient application than applying the arguments successively. @@ -2175,7 +2175,7 @@ namespace Microsoft.FSharp.Core /// The third arg. /// /// The function result. - static member InvokeFast: func: FSharpFunc<'T,('U -> 'V -> 'W)> * arg1: 'T * arg2: 'U * arg3: 'V -> 'W + static member InvokeFast: func: FSharpFunc<'T, 'U -> 'V -> 'W> * arg1: 'T * arg2: 'U * arg3: 'V -> 'W /// Invoke an F# first class function value with two curried arguments. In some cases this /// will result in a more efficient application than applying the arguments successively. @@ -2185,7 +2185,7 @@ namespace Microsoft.FSharp.Core /// The second arg. /// /// The function result. - static member InvokeFast: func: FSharpFunc<'T,('U -> 'V)> * arg1: 'T * arg2: 'U -> 'V + static member InvokeFast: func: FSharpFunc<'T, 'U -> 'V> * arg1: 'T * arg2: 'U -> 'V /// Helper functions for converting F# first class function values to and from CLI representations /// of functions using delegates. @@ -2330,7 +2330,7 @@ namespace Microsoft.FSharp.Core /// typically used directly from either F# code or from other CLI languages. [] type FSharpFunc<'T1,'T2,'U> = - inherit FSharpFunc<'T1,('T2 -> 'U)> + inherit FSharpFunc<'T1, 'T2 -> 'U> /// Invoke the optimized function value with two curried arguments /// @@ -2359,7 +2359,7 @@ namespace Microsoft.FSharp.Core [] type FSharpFunc<'T1,'T2,'T3,'U> = - inherit FSharpFunc<'T1,('T2 -> 'T3 -> 'U)> + inherit FSharpFunc<'T1, 'T2 -> 'T3 -> 'U> /// Invoke an F# first class function value that accepts three curried arguments /// without intervening execution @@ -2389,7 +2389,7 @@ namespace Microsoft.FSharp.Core /// either F# code or from other CLI languages. [] type FSharpFunc<'T1,'T2,'T3,'T4,'U> = - inherit FSharpFunc<'T1,('T2 -> 'T3 -> 'T4 -> 'U)> + inherit FSharpFunc<'T1, 'T2 -> 'T3 -> 'T4 -> 'U> /// Invoke an F# first class function value that accepts four curried arguments /// without intervening execution @@ -2420,7 +2420,7 @@ namespace Microsoft.FSharp.Core /// either F# code or from other CLI languages. [] type FSharpFunc<'T1,'T2,'T3,'T4,'T5,'U> = - inherit FSharpFunc<'T1,('T2 -> 'T3 -> 'T4 -> 'T5 -> 'U)> + inherit FSharpFunc<'T1, 'T2 -> 'T3 -> 'T4 -> 'T5 -> 'U> /// Invoke an F# first class function value that accepts five curried arguments /// without intervening execution diff --git a/src/FSharp.Core/printf.fs b/src/FSharp.Core/printf.fs index d16e422117b..3c01be097e2 100644 --- a/src/FSharp.Core/printf.fs +++ b/src/FSharp.Core/printf.fs @@ -349,7 +349,7 @@ module internal PrintfImpl = env.WriteSkipEmpty prefix let farg = args.[argIndex] argIndex <- argIndex + 1 - let f = farg :?> ('State -> 'Residue) + let f = farg :?> 'State -> 'Residue env.WriteT(f env.State) | StepLittleA(prefix) -> @@ -358,7 +358,7 @@ module internal PrintfImpl = argIndex <- argIndex + 1 let arg = args.[argIndex] argIndex <- argIndex + 1 - let f = farg :?> ('State -> objnull -> 'Residue) + let f = farg :?> 'State -> objnull -> 'Residue env.WriteT(f env.State arg) | StepStar1(prefix, conv) -> @@ -407,7 +407,8 @@ module internal PrintfImpl = /// f3 8 // same activation captures 8 (args --> [3;5;8]) /// /// If we captured into an mutable array then these would interfere - type PrintfInitial<'State, 'Residue, 'Result> = (unit -> PrintfEnv<'State, 'Residue, 'Result>) + type PrintfInitial<'State, 'Residue, 'Result> = unit -> PrintfEnv<'State, 'Residue, 'Result> + type PrintfFuncFactory<'Printer, 'State, 'Residue, 'Result> = delegate of objnull list * PrintfInitial<'State, 'Residue, 'Result> -> 'Printer @@ -620,8 +621,7 @@ module internal PrintfImpl = pad spec.Width) else // width=X, prec=* - ValueConverter.Make ( - basic) + ValueConverter.Make basic let withPaddingFormatted (spec: FormatSpecifier) getFormat (defaultFormat: string) (f: string -> objnull -> string) left right : ValueConverter = if not (spec.IsWidthSpecified || spec.IsPrecisionSpecified) then @@ -1148,10 +1148,10 @@ module internal PrintfImpl = let argTy = match argTys with null -> typeof | _ -> argTys.[argTys.Length - 1] let conv = getValueConverter argTy spec if isTwoStar then - let convFunc = conv.FuncObj :?> (objnull -> int -> int -> string) + let convFunc = conv.FuncObj :?> objnull -> int -> int -> string StepStar2 (prefix, convFunc) else - let convFunc = conv.FuncObj :?> (objnull -> int -> string) + let convFunc = conv.FuncObj :?> objnull -> int -> string StepStar1 (prefix, convFunc) else // For interpolated string format processing, the static types of the '%A' arguments @@ -1161,7 +1161,7 @@ module internal PrintfImpl = let convFunc arg argTy = let mi = mi_GenericToString.MakeGenericMethod [| argTy |] let f = mi.Invoke(null, [| box spec |]) :?> ValueConverter - let f2 = f.FuncObj :?> (objnull -> string) + let f2 = f.FuncObj :?> objnull -> string f2 arg StepWithTypedArg (prefix, convFunc) @@ -1171,7 +1171,7 @@ module internal PrintfImpl = // are provided via the argument typed extracted from the curried function. They are known on first phase. let argTy = match argTys with null -> typeof | _ -> argTys.[0] let conv = getValueConverter argTy spec - let convFunc = conv.FuncObj :?> (objnull -> string) + let convFunc = conv.FuncObj :?> objnull -> string StepWithArg (prefix, convFunc) let parseSpec (i: byref) = @@ -1249,9 +1249,9 @@ module internal PrintfImpl = let spec = parseSpec &i let suffix = FormatString.findNextFormatSpecifier fmt &i let n = spec.ArgCount - let (argTys, retTy) = extractCurriedArguments funcTy n + let argTys, retTy = extractCurriedArguments funcTy n let step = buildStep spec argTys prefix - let (allSteps, nextInfo) = parseAndCreateFuncFactoryAux (step::steps) suffix retTy &i + let allSteps, nextInfo = parseAndCreateFuncFactoryAux (step::steps) suffix retTy &i let nextInfoNew = buildCaptureFunc (spec, allSteps, argTys, retTy, nextInfo) (allSteps, nextInfoNew) @@ -1262,7 +1262,7 @@ module internal PrintfImpl = let mutable i = 0 let prefix = FormatString.findNextFormatSpecifier fmt &i - let (allSteps, (factoryObj, _, combinedArgTys, _, _)) = parseAndCreateFuncFactoryAux [] prefix funcTy &i + let allSteps, (factoryObj, _, combinedArgTys, _, _) = parseAndCreateFuncFactoryAux [] prefix funcTy &i // If there are no format specifiers then take a simple path match allSteps with diff --git a/src/FSharp.Core/quotations.fs b/src/FSharp.Core/quotations.fs index 7d16efc2146..a69e669681b 100644 --- a/src/FSharp.Core/quotations.fs +++ b/src/FSharp.Core/quotations.fs @@ -104,7 +104,7 @@ type Var(name: string, typ: Type, ?isMutable: bool) = let mutable lastStamp = -1L // first value retrieved will be 0 fun () -> System.Threading.Interlocked.Increment &lastStamp - static let globals = Dictionary<(string * Type), Var>(11) + static let globals = Dictionary(11) let stamp = getStamp () let isMutable = defaultArg isMutable false @@ -399,10 +399,10 @@ and [] Expr( let argsWithoutWitnesses = List.skip nWitnesses args combL "Call" [ noneL; minfoL minfo; listL (exprs argsWithoutWitnesses) ] - | CombTerm(InstancePropGetOp(pinfo), (obj :: args)) -> + | CombTerm(InstancePropGetOp(pinfo), obj :: args) -> combL "PropertyGet" [ someL obj; pinfoL pinfo; listL (exprs args) ] | CombTerm(StaticPropGetOp(pinfo), args) -> combL "PropertyGet" [ noneL; pinfoL pinfo; listL (exprs args) ] - | CombTerm(InstancePropSetOp(pinfo), (obj :: args)) -> + | CombTerm(InstancePropSetOp(pinfo), obj :: args) -> combL "PropertySet" [ someL obj; pinfoL pinfo; listL (exprs args) ] | CombTerm(StaticPropSetOp(pinfo), args) -> combL "PropertySet" [ noneL; pinfoL pinfo; listL (exprs args) ] | CombTerm(InstanceFieldGetOp(finfo), [ obj ]) -> combL "FieldGet" [ someL obj; finfoL finfo ] @@ -498,7 +498,7 @@ module Patterns = loop [] es - let funTyC = typeof<(obj -> obj)>.GetGenericTypeDefinition() + let funTyC = typeof obj>.GetGenericTypeDefinition() let exprTyC = typedefof> let voidTy = typeof let unitTy = typeof @@ -507,7 +507,7 @@ module Patterns = if a = voidTy then unitTy else a let mkFunTy a b = - let (a, b) = removeVoid a, removeVoid b + let a, b = removeVoid a, removeVoid b funTyC.MakeGenericType([| a; b |]) let mkArrayTy (t: Type) = @@ -587,7 +587,7 @@ module Patterns = [] let (|NewTuple|_|) input = match input with - | E(CombTerm(NewTupleOp(_), es)) -> Some es + | E(CombTerm(NewTupleOp _, es)) -> Some es | _ -> None [] @@ -755,7 +755,7 @@ module Patterns = match input with | E(CombTerm(StaticMethodCallOp minfo, args)) -> Some(None, minfo, args) - | E(CombTerm(InstanceMethodCallOp minfo, (obj :: args))) -> Some(Some(obj), minfo, args) + | E(CombTerm(InstanceMethodCallOp minfo, obj :: args)) -> Some(Some(obj), minfo, args) // A StaticMethodCallWOp matches as if it were a StaticMethodCallOp | E(CombTerm(StaticMethodCallWOp(minfo, _minfoW, nWitnesses), args)) when nWitnesses <= args.Length -> @@ -1076,7 +1076,7 @@ module Patterns = let mkLetRaw v = mkFE2 LetOp v - let mkLetRawWithCheck ((e1, e2) as v) = + let mkLetRawWithCheck (e1, e2 as v) = checkAppliedLambda (e2, e1) mkLetRaw v @@ -1090,7 +1090,7 @@ module Patterns = List.iter2 (fun mt a -> checkTypesSR mt (typeOf a) "args" (SR.GetString(SR.QtmmTuple))) mems args mkFEN (NewTupleOp ty) args - let mkNewTuple (args) = + let mkNewTuple args = let ty = FSharpType.MakeTupleType(Array.map typeOf (Array.ofList args)) mkFEN (NewTupleOp ty) args @@ -1154,7 +1154,7 @@ module Patterns = // Conditional etc.. let mkIfThenElse (e, t, f) = checkTypesSR (typeOf t) (typeOf f) "cond" (SR.GetString(SR.QtmmTrueAndFalseMustMatch)) - checkTypesSR (typeof) (typeOf e) "cond" (SR.GetString(SR.QtmmCondMustBeBool)) + checkTypesSR typeof (typeOf e) "cond" (SR.GetString(SR.QtmmCondMustBeBool)) mkFE3 IfThenElseOp (e, t, f) let mkNewArray (ty, args) = @@ -1312,15 +1312,15 @@ module Patterns = | false -> invalidArg "minfo" (SR.GetString(SR.QnonStaticNoReceiverObject)) let mkForLoop (v: Var, lowerBound, upperBound, body) = - checkTypesSR (typeof) (typeOf lowerBound) "lowerBound" (SR.GetString(SR.QtmmLowerUpperBoundMustBeInt)) - checkTypesSR (typeof) (typeOf upperBound) "upperBound" (SR.GetString(SR.QtmmLowerUpperBoundMustBeInt)) - checkTypesSR (typeof) (v.Type) "for" (SR.GetString(SR.QtmmLoopBodyMustBeLambdaTakingInteger)) + checkTypesSR typeof (typeOf lowerBound) "lowerBound" (SR.GetString(SR.QtmmLowerUpperBoundMustBeInt)) + checkTypesSR typeof (typeOf upperBound) "upperBound" (SR.GetString(SR.QtmmLowerUpperBoundMustBeInt)) + checkTypesSR typeof v.Type "for" (SR.GetString(SR.QtmmLoopBodyMustBeLambdaTakingInteger)) mkFE3 ForIntegerRangeLoopOp (lowerBound, upperBound, mkLambda (v, body)) let mkWhileLoop (guard, body) = - checkTypesSR (typeof) (typeOf guard) "guard" (SR.GetString(SR.QtmmGuardMustBeBool)) - checkTypesSR (typeof) (typeOf body) "body" (SR.GetString(SR.QtmmBodyMustBeUnit)) - mkFE2 (WhileLoopOp) (guard, body) + checkTypesSR typeof (typeOf guard) "guard" (SR.GetString(SR.QtmmGuardMustBeBool)) + checkTypesSR typeof (typeOf body) "body" (SR.GetString(SR.QtmmBodyMustBeUnit)) + mkFE2 WhileLoopOp (guard, body) let mkNewDelegate (ty, e) = let mi = getDelegateInvoke ty @@ -2019,7 +2019,7 @@ module Patterns = (fun tyargs -> getUnionCaseInfoField (case tyargs, i)) and u_ModuleDefn witnessInfo st = - let (ty, nm, isProp) = u_tup3 u_NamedType u_string u_bool st + let ty, nm, isProp = u_tup3 u_NamedType u_string u_bool st if isProp then Unique(StaticPropGetOp(bindModuleProperty (ty, nm))) @@ -2073,10 +2073,10 @@ module Patterns = match u_ModuleDefn None st with | Unique(StaticMethodCallOp minfo) -> (minfo :> MethodBase) | Unique(StaticPropGetOp pinfo) -> (pinfo.GetGetMethod true :> MethodBase) - | Ambiguous(_) -> raise (AmbiguousMatchException()) + | Ambiguous _ -> raise (AmbiguousMatchException()) | _ -> failwith "unreachable" | 1 -> - let ((genericType, _, _, methName, _) as data) = u_MethodInfoData st + let genericType, _, _, methName, _ as data = u_MethodInfoData st if methName = ".cctor" then let cinfo = bindGenericCctor genericType @@ -2096,7 +2096,7 @@ module Patterns = | Unique(StaticMethodCallOp(minfo)) -> (minfo :> MethodBase) | Unique(StaticMethodCallWOp(_minfo, minfoW, _)) -> (minfoW :> MethodBase) | Unique(StaticPropGetOp(pinfo)) -> (pinfo.GetGetMethod(true) :> MethodBase) - | Ambiguous(_) -> raise (AmbiguousMatchException()) + | Ambiguous _ -> raise (AmbiguousMatchException()) | _ -> failwith "unreachable" | _ -> failwith "u_MethodBase" @@ -2439,7 +2439,7 @@ module Patterns = match data with | Some(Entry exprBuilder) -> let expectedNumTypars = - getNumGenericArguments (methodBase.DeclaringType) + getNumGenericArguments methodBase.DeclaringType + (match methodBase with | :? MethodInfo as minfo -> if minfo.IsGenericMethod then @@ -2488,7 +2488,7 @@ module Patterns = fillHolesInRawExpr spliceExprs expr let cast (expr: Expr) : Expr<'T> = - checkTypesSR (typeof<'T>) (typeOf expr) "expr" (SR.GetString(SR.QtmmExprHasWrongType)) + checkTypesSR typeof<'T> (typeOf expr) "expr" (SR.GetString(SR.QtmmExprHasWrongType)) new Expr<'T>(expr.Tree, expr.CustomAttributes) open Patterns @@ -2847,7 +2847,7 @@ module DerivedPatterns = let (|SpecificCall|_|) templateParameter = // Note: precomputation match templateParameter with - | (Lambdas(_, Call(_, minfo1, _)) | Call(_, minfo1, _)) -> + | Lambdas(_, Call(_, minfo1, _)) | Call(_, minfo1, _) -> let isg1 = minfo1.IsGenericMethod let gmd = @@ -2893,7 +2893,7 @@ module DerivedPatterns = | _ -> None [] - let (|MethodWithReflectedDefinition|_|) (methodBase) = + let (|MethodWithReflectedDefinition|_|) methodBase = Expr.TryGetReflectedDefinition methodBase [] @@ -2908,7 +2908,7 @@ module DerivedPatterns = module ExprShape = let RebuildShapeCombination (shape: objnull, arguments) = // preserve the attributes - let op, attrs = unbox (shape) + let op, attrs = unbox shape let e = match op, arguments with @@ -2922,12 +2922,12 @@ module ExprShape = | UnionCaseTestOp unionCase, [ arg ] -> mkUnionCaseTest (unionCase, arg) | NewTupleOp ty, _ -> mkNewTupleWithType (ty, arguments) | TupleGetOp(ty, i), [ arg ] -> mkTupleGet (ty, i, arg) - | InstancePropGetOp pinfo, (obj :: args) -> mkInstancePropGet (obj, pinfo, args) + | InstancePropGetOp pinfo, obj :: args -> mkInstancePropGet (obj, pinfo, args) | StaticPropGetOp pinfo, _ -> mkStaticPropGet (pinfo, arguments) - | InstancePropSetOp pinfo, obj :: (FrontAndBack(args, v)) -> mkInstancePropSet (obj, pinfo, args, v) - | StaticPropSetOp pinfo, (FrontAndBack(args, v)) -> mkStaticPropSet (pinfo, args, v) + | InstancePropSetOp pinfo, obj :: FrontAndBack(args, v) -> mkInstancePropSet (obj, pinfo, args, v) + | StaticPropSetOp pinfo, FrontAndBack(args, v) -> mkStaticPropSet (pinfo, args, v) | InstanceFieldGetOp finfo, [ obj ] -> mkInstanceFieldGet (obj, finfo) - | StaticFieldGetOp finfo, [] -> mkStaticFieldGet (finfo) + | StaticFieldGetOp finfo, [] -> mkStaticFieldGet finfo | InstanceFieldSetOp finfo, [ obj; v ] -> mkInstanceFieldSet (obj, finfo, v) | StaticFieldSetOp finfo, [ v ] -> mkStaticFieldSet (finfo, v) | NewObjectOp minfo, _ -> mkCtorCall (minfo, arguments) diff --git a/src/FSharp.Core/quotations.fsi b/src/FSharp.Core/quotations.fsi index 46134946bbc..244cc4afa54 100644 --- a/src/FSharp.Core/quotations.fsi +++ b/src/FSharp.Core/quotations.fsi @@ -1576,7 +1576,7 @@ module Patterns = /// /// [] - val (|NewTuple|_|): input: Expr -> (Expr list) option + val (|NewTuple|_|): input: Expr -> Expr list option /// An active pattern to recognize expressions that represent construction of struct tuple values /// @@ -1586,7 +1586,7 @@ module Patterns = /// /// [] - val (|NewStructTuple|_|): input: Expr -> (Expr list) option + val (|NewStructTuple|_|): input: Expr -> Expr list option /// An active pattern to recognize expressions that represent the read of a static or instance property, or a non-function value declared in a module /// @@ -2267,7 +2267,7 @@ module ExprShape = /// /// [] - val (|ShapeVar|ShapeLambda|ShapeCombination|): input: Expr -> Choice + val (|ShapeVar|ShapeLambda|ShapeCombination|): input: Expr -> Choice /// Re-build combination expressions. The first parameter should be an object /// returned by the ShapeCombination case of the active pattern in this module. diff --git a/src/FSharp.Core/reflect.fs b/src/FSharp.Core/reflect.fs index 997b075a3dd..3290ec8a278 100644 --- a/src/FSharp.Core/reflect.fs +++ b/src/FSharp.Core/reflect.fs @@ -46,16 +46,16 @@ module internal Impl = else Type.op_Equality (ty1, ty2) - let func = typedefof<(objnull -> objnull)> + let func = typedefof objnull> let isOptionType typ = - equivHeadTypes typ (typeof) + equivHeadTypes typ typeof let isFunctionType typ = - equivHeadTypes typ (typeof<(int -> int)>) + equivHeadTypes typ typeof int> let isListType typ = - equivHeadTypes typ (typeof) + equivHeadTypes typ typeof //----------------------------------------------------------------- // GENERAL UTILITIES @@ -333,7 +333,7 @@ module internal Impl = ) let sequenceNumberOfMember (x: MemberInfo) = - let (_, n, _) = findCompilationMappingAttributeFromMemberInfo x |> Array.head + let _, n, _ = findCompilationMappingAttributeFromMemberInfo x |> Array.head n let sequenceNumberOfUnionCaseField (x: MemberInfo) caseTag = @@ -354,7 +354,7 @@ module internal Impl = match findCompilationMappingAttributeFromMemberInfo prop with | [||] -> false | arr -> - let (flags, _, _) = arr |> Array.head + let flags, _, _ = arr |> Array.head (flags &&& SourceConstructFlags.KindMask) = SourceConstructFlags.Field let tryFindSourceConstructFlagsOfType (typ: Type) = @@ -376,7 +376,7 @@ module internal Impl = match findCompilationMappingAttributeFromMemberInfo minfo with | [||] -> None | arr -> - let (flags, n, _) = arr |> Array.head + let flags, n, _ = arr |> Array.head if (flags &&& SourceConstructFlags.KindMask) = SourceConstructFlags.UnionCase then let nm = minfo.Name @@ -523,7 +523,7 @@ module internal Impl = let caseTyp = if isNull caseTyp then typ else caseTyp compileRecordOrUnionCaseReaderFunc(caseTyp, props).Invoke - let getUnionTagReader (typ: Type, bindingFlags) : (objnull -> int) = + let getUnionTagReader (typ: Type, bindingFlags) : objnull -> int = if isOptionType typ then (fun (obj: objnull) -> match obj with @@ -543,7 +543,7 @@ module internal Impl = (fun (obj: objnull) -> m2b.Invoke(null, [| obj |]) :?> int) - let getUnionTagReaderCompiled (typ: Type, bindingFlags) : (objnull -> int) = + let getUnionTagReaderCompiled (typ: Type, bindingFlags) : objnull -> int = if isOptionType typ then (fun (obj: objnull) -> match obj with @@ -1053,7 +1053,7 @@ module internal Impl = let msg = String.Format(SR.GetString(SR.notARecordType), recordType.FullName) invalidArg argName msg - let checkTupleType (argName, (tupleType: Type)) = + let checkTupleType (argName, tupleType: Type) = checkNonNull argName tupleType if not (isTupleType tupleType) then @@ -1227,7 +1227,7 @@ type DynamicFunction<'T1, 'T2>() = inherit FSharpFunc obj, obj>() override _.Invoke(impl: obj -> obj) : obj = - box<('T1 -> 'T2)> (fun inp -> unbox<'T2> (impl (box<'T1> (inp)))) + box<'T1 -> 'T2> (fun inp -> unbox<'T2> (impl (box<'T1> inp))) [] type FSharpValue = @@ -1261,7 +1261,7 @@ type FSharpValue = checkNonNull "info" info compilePropGetterFunc(info).Invoke - static member PreComputeRecordReader(recordType: Type, ?bindingFlags) : (obj -> objnull array) = + static member PreComputeRecordReader(recordType: Type, ?bindingFlags) : obj -> objnull array = let bindingFlags = defaultArg bindingFlags BindingFlags.Public checkRecordType ("recordType", recordType, bindingFlags) getRecordReaderCompiled (recordType, bindingFlags) @@ -1276,7 +1276,7 @@ type FSharpValue = checkRecordType ("recordType", recordType, bindingFlags) getRecordConstructorMethod (recordType, bindingFlags) - static member MakeFunction(functionType: Type, implementation: (objnull -> objnull)) = + static member MakeFunction(functionType: Type, implementation: objnull -> objnull) = checkNonNull "functionType" functionType if not (isFunctionType functionType) then @@ -1324,7 +1324,7 @@ type FSharpValue = fields.[index] - static member PreComputeTupleReader(tupleType: Type) : (obj -> objnull array) = + static member PreComputeTupleReader(tupleType: Type) : obj -> objnull array = checkTupleType ("tupleType", tupleType) (compileTupleReader tupleEncField getTupleElementAccessors tupleType).Invoke @@ -1377,7 +1377,7 @@ type FSharpValue = let flds = getUnionCaseRecordReader (unionType, tag, bindingFlags) value UnionCaseInfo(unionType, tag), flds - static member PreComputeUnionTagReader(unionType: Type, ?bindingFlags) : (objnull -> int) = + static member PreComputeUnionTagReader(unionType: Type, ?bindingFlags) : objnull -> int = let bindingFlags = defaultArg bindingFlags BindingFlags.Public checkNonNull "unionType" unionType let unionType = getTypeOfReprType (unionType, bindingFlags) @@ -1391,7 +1391,7 @@ type FSharpValue = checkUnionType (unionType, bindingFlags) getUnionTagMemberInfo (unionType, bindingFlags) - static member PreComputeUnionReader(unionCase: UnionCaseInfo, ?bindingFlags) : (objnull -> objnull array) = + static member PreComputeUnionReader(unionCase: UnionCaseInfo, ?bindingFlags) : objnull -> objnull array = let bindingFlags = defaultArg bindingFlags BindingFlags.Public checkNonNull "unionCase" unionCase let typ = unionCase.DeclaringType @@ -1444,7 +1444,7 @@ module FSharpReflectionExtensions = static member PreComputeRecordReader (recordType: Type, ?allowAccessToPrivateRepresentation) - : (obj -> objnull array) = + : obj -> objnull array = let bindingFlags = getBindingFlags allowAccessToPrivateRepresentation FSharpValue.PreComputeRecordReader(recordType, bindingFlags) @@ -1478,13 +1478,13 @@ module FSharpReflectionExtensions = static member PreComputeUnionTagReader (unionType: Type, ?allowAccessToPrivateRepresentation) - : (objnull -> int) = + : objnull -> int = let bindingFlags = getBindingFlags allowAccessToPrivateRepresentation FSharpValue.PreComputeUnionTagReader(unionType, bindingFlags) static member PreComputeUnionReader (unionCase: UnionCaseInfo, ?allowAccessToPrivateRepresentation) - : (objnull -> objnull array) = + : objnull -> objnull array = let bindingFlags = getBindingFlags allowAccessToPrivateRepresentation FSharpValue.PreComputeUnionReader(unionCase, bindingFlags) diff --git a/src/FSharp.Core/resumable.fs b/src/FSharp.Core/resumable.fs index ca99f95201d..1ace0d12241 100644 --- a/src/FSharp.Core/resumable.fs +++ b/src/FSharp.Core/resumable.fs @@ -172,7 +172,7 @@ module ResumableCode = let rf = GetResumptionFunc &sm sm.ResumptionDynamicInfo.ResumptionFunc <- - (ResumptionFunc<'Data>(fun sm -> WhileBodyDynamicAux(&sm, condition, body, rf))) + ResumptionFunc<'Data>(fun sm -> WhileBodyDynamicAux(&sm, condition, body, rf)) false else @@ -191,7 +191,7 @@ module ResumableCode = let rf = GetResumptionFunc &sm sm.ResumptionDynamicInfo.ResumptionFunc <- - (ResumptionFunc<'Data>(fun sm -> WhileBodyDynamicAux(&sm, condition, body, rf))) + ResumptionFunc<'Data>(fun sm -> WhileBodyDynamicAux(&sm, condition, body, rf)) false @@ -230,8 +230,8 @@ module ResumableCode = let rf = GetResumptionFunc &sm sm.ResumptionDynamicInfo.ResumptionFunc <- - (ResumptionFunc<'Data>(fun sm -> - TryWithDynamic(&sm, ResumableCode<'Data, 'T>(fun sm -> rf.Invoke(&sm)), handler))) + ResumptionFunc<'Data>(fun sm -> + TryWithDynamic(&sm, ResumableCode<'Data, 'T>(fun sm -> rf.Invoke(&sm)), handler)) false with exn -> @@ -286,7 +286,7 @@ module ResumableCode = let rf = GetResumptionFunc &sm sm.ResumptionDynamicInfo.ResumptionFunc <- - (ResumptionFunc<'Data>(fun sm -> TryFinallyCompensateDynamic(&sm, rf, savedExn))) + ResumptionFunc<'Data>(fun sm -> TryFinallyCompensateDynamic(&sm, rf, savedExn)) false @@ -311,8 +311,8 @@ module ResumableCode = let rf = GetResumptionFunc &sm sm.ResumptionDynamicInfo.ResumptionFunc <- - (ResumptionFunc<'Data>(fun sm -> - TryFinallyAsyncDynamic(&sm, ResumableCode<'Data, 'T>(fun sm -> rf.Invoke(&sm)), compensation))) + ResumptionFunc<'Data>(fun sm -> + TryFinallyAsyncDynamic(&sm, ResumableCode<'Data, 'T>(fun sm -> rf.Invoke(&sm)), compensation)) false diff --git a/src/FSharp.Core/seq.fs b/src/FSharp.Core/seq.fs index d1a4ab48d5d..c05dbdc3701 100644 --- a/src/FSharp.Core/seq.fs +++ b/src/FSharp.Core/seq.fs @@ -332,7 +332,7 @@ module Internal = let setIndex i = index <- i - current <- (Unchecked.defaultof<_>) // cache node unprimed, initialised on demand. + current <- Unchecked.defaultof<_> // cache node unprimed, initialised on demand. let getCurrent () = if index = unstarted then @@ -1679,7 +1679,7 @@ module Seq = checkNonNull "source" source use e = source.GetEnumerator() - if (e.MoveNext()) then + if e.MoveNext() then e.Current else invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString @@ -1689,7 +1689,7 @@ module Seq = checkNonNull "source" source use e = source.GetEnumerator() - if (e.MoveNext()) then + if e.MoveNext() then Some e.Current else None diff --git a/src/FSharp.Core/seq.fsi b/src/FSharp.Core/seq.fsi index 24189d3730c..526becf4dd1 100644 --- a/src/FSharp.Core/seq.fsi +++ b/src/FSharp.Core/seq.fsi @@ -84,7 +84,7 @@ module Seq = /// [] val inline average: - source: seq<(^T)> -> ^T + source: seq<^T> -> ^T when ^T: (static member (+): ^T * ^T -> ^T) and ^T: (static member DivideByInt: ^T * int -> ^T) and ^T: (static member Zero: ^T) @@ -2346,7 +2346,7 @@ module Seq = /// Evaluates to 11. /// [] - val inline sum: source: seq<(^T)> -> ^T when ^T: (static member (+): ^T * ^T -> ^T) and ^T: (static member Zero: ^T) + val inline sum: source: seq<^T> -> ^T when ^T: (static member (+): ^T * ^T -> ^T) and ^T: (static member Zero: ^T) /// Returns the sum of the results generated by applying the function to each element of the sequence. /// diff --git a/src/FSharp.Core/seqcore.fs b/src/FSharp.Core/seqcore.fs index bf82c8eab56..1445f9b16c0 100644 --- a/src/FSharp.Core/seqcore.fs +++ b/src/FSharp.Core/seqcore.fs @@ -383,7 +383,7 @@ module RuntimeHelpers = let EnumerateTryWith (source : seq<'T>) (exceptionFilter:exn -> int) (exceptionHandler:exn -> seq<'T>) = - let originalSource = lazy(source.GetEnumerator()) + let originalSource = lazy source.GetEnumerator() let mutable shouldDisposeOriginalAtTheEnd = true let mutable exceptionalSource : IEnumerator<'T> option = None @@ -397,7 +397,7 @@ module RuntimeHelpers = shouldDisposeOriginalAtTheEnd <- false originalSource.Value.Dispose() - let moveExceptionHandler(exn) = + let moveExceptionHandler exn = exceptionalSource <- Some ((exceptionHandler exn).GetEnumerator()) exceptionalSource.Value.MoveNext() @@ -492,7 +492,7 @@ type GeneratedSequenceBase<'T>() = member x.GetFreshEnumerator() = e [] - member x.GenerateNext(_) = if e.MoveNext() then 1 else 0 + member x.GenerateNext _ = if e.MoveNext() then 1 else 0 member x.Close() = try e.Dispose() finally active.Close() diff --git a/src/FSharp.Core/seqcore.fsi b/src/FSharp.Core/seqcore.fsi index a93af1819d5..17226767a2d 100644 --- a/src/FSharp.Core/seqcore.fsi +++ b/src/FSharp.Core/seqcore.fsi @@ -62,7 +62,7 @@ module RuntimeHelpers = member Value: 'T static member Comparer: IEqualityComparer> - val internal mkConcatSeq: sources: (seq<#seq<'T>>) -> seq<'T> + val internal mkConcatSeq: sources: seq<#seq<'T>> -> seq<'T> /// The F# compiler emits calls to this function to /// implement the while operator for F# sequence expressions. diff --git a/src/FSharp.Core/set.fs b/src/FSharp.Core/set.fs index bc8e833cc96..fd8478a60a2 100644 --- a/src/FSharp.Core/set.fs +++ b/src/FSharp.Core/set.fs @@ -115,19 +115,19 @@ module internal SetTree = let t2h = height t2 if t2h > t1h + tolerance then // right is heavier than left - let t2' = asNode (t2) + let t2' = asNode t2 // one of the nodes must have height > height t1 + 1 if height t2'.Left > t1h + 1 then // balance left: combination - let t2l = asNode (t2'.Left) + let t2l = asNode t2'.Left mk (mk t1 v t2l.Left) t2l.Key (mk t2l.Right t2'.Key t2'.Right) else // rotate left mk (mk t1 v t2'.Left) t2.Key t2'.Right else if t1h > t2h + tolerance then // left is heavier than right - let t1' = asNode (t1) + let t1' = asNode t1 // one of the nodes must have height > height t2 + 1 if height t1'.Right > t2h + 1 then // balance right: combination - let t1r = asNode (t1'.Right) + let t1r = asNode t1'.Right mk (mk t1'.Left t1.Key t1r.Left) t1r.Key (mk t1r.Right v t2) else mk t1'.Left t1'.Key (mk t1'.Right v t2) @@ -565,7 +565,7 @@ module internal SetTree = let rec compareStacks (comparer: IComparer<'T>) (l1: SetTree<'T> list) (l2: SetTree<'T> list) : int = let cont () = match l1, l2 with - | (x1 :: t1), _ when not (isEmpty x1) -> + | x1 :: t1, _ when not (isEmpty x1) -> if x1.Height = 1 then compareStacks comparer (empty :: SetTree x1.Key :: t1) l2 else @@ -575,7 +575,7 @@ module internal SetTree = comparer (x1n.Left :: (SetTreeNode(x1n.Key, empty, x1n.Right, 0) :> SetTree<'T>) :: t1) l2 - | _, (x2 :: t2) when not (isEmpty x2) -> + | _, x2 :: t2 when not (isEmpty x2) -> if x2.Height = 1 then compareStacks comparer l1 (empty :: SetTree x2.Key :: t2) else @@ -591,7 +591,7 @@ module internal SetTree = | [], [] -> 0 | [], _ -> -1 | _, [] -> 1 - | (x1 :: t1), (x2 :: t2) -> + | x1 :: t1, x2 :: t2 -> if isEmpty x1 then if isEmpty x2 then compareStacks comparer t1 t2 @@ -799,7 +799,7 @@ type Set<[] 'T when 'T: comparison>(comparer: IComparer<' member s.Map f : Set<'U> = let comparer = LanguagePrimitives.FastGenericComparer<'U> - Set(comparer, SetTree.fold (fun acc k -> SetTree.add comparer (f k) acc) (SetTree.empty) s.Tree) + Set(comparer, SetTree.fold (fun acc k -> SetTree.add comparer (f k) acc) SetTree.empty s.Tree) member s.Exists f = SetTree.exists f s.Tree @@ -904,7 +904,7 @@ type Set<[] 'T when 'T: comparison>(comparer: IComparer<' interface IComparable with member this.CompareTo(that: objnull) = - SetTree.compare this.Comparer this.Tree ((that :?> Set<'T>).Tree) + SetTree.compare this.Comparer this.Tree (that :?> Set<'T>).Tree interface IStructuralEquatable with member this.Equals(that, comparer) = @@ -916,7 +916,7 @@ type Set<[] 'T when 'T: comparison>(comparer: IComparer<' let rec loop () = let m1 = e1.MoveNext() let m2 = e2.MoveNext() - (m1 = m2) && (not m1 || ((comparer.Equals(e1.Current, e2.Current)) && loop ())) + (m1 = m2) && (not m1 || (comparer.Equals(e1.Current, e2.Current) && loop ())) loop () | _ -> false diff --git a/src/FSharp.Core/string.fs b/src/FSharp.Core/string.fs index ff327c8c3b2..800fcdd7826 100644 --- a/src/FSharp.Core/string.fs +++ b/src/FSharp.Core/string.fs @@ -41,7 +41,7 @@ module String = | _ -> String.Join(sep, strings) [] - let iter (action: (char -> unit)) (str: string) = + let iter (action: char -> unit) (str: string) = if not (String.IsNullOrEmpty str) then for i = 0 to str.Length - 1 do action str.[i] diff --git a/src/FSharp.Core/tasks.fs b/src/FSharp.Core/tasks.fs index fff67a0e1d6..eec12a86c63 100644 --- a/src/FSharp.Core/tasks.fs +++ b/src/FSharp.Core/tasks.fs @@ -297,18 +297,18 @@ module LowPriority = and ^Awaiter :> ICriticalNotifyCompletion and ^Awaiter: (member get_IsCompleted: unit -> bool) and ^Awaiter: (member GetResult: unit -> 'TResult1)> - (sm: byref<_>, task: ^TaskLike, continuation: ('TResult1 -> TaskCode<'TOverall, 'TResult2>)) + (sm: byref<_>, task: ^TaskLike, continuation: 'TResult1 -> TaskCode<'TOverall, 'TResult2>) : bool = - let mutable awaiter = (^TaskLike: (member GetAwaiter: unit -> ^Awaiter) (task)) + let mutable awaiter = (^TaskLike: (member GetAwaiter: unit -> ^Awaiter) task) let cont = - (TaskResumptionFunc<'TOverall>(fun sm -> - let result = (^Awaiter: (member GetResult: unit -> 'TResult1) (awaiter)) - (continuation result).Invoke(&sm))) + TaskResumptionFunc<'TOverall>(fun sm -> + let result = (^Awaiter: (member GetResult: unit -> 'TResult1) awaiter) + (continuation result).Invoke(&sm)) // shortcut to continue immediately - if (^Awaiter: (member get_IsCompleted: unit -> bool) (awaiter)) then + if (^Awaiter: (member get_IsCompleted: unit -> bool) awaiter) then cont.Invoke(&sm) else sm.ResumptionDynamicInfo.ResumptionData <- (awaiter :> ICriticalNotifyCompletion) @@ -321,25 +321,25 @@ module LowPriority = and ^Awaiter :> ICriticalNotifyCompletion and ^Awaiter: (member get_IsCompleted: unit -> bool) and ^Awaiter: (member GetResult: unit -> 'TResult1)> - (task: ^TaskLike, continuation: ('TResult1 -> TaskCode<'TOverall, 'TResult2>)) + (task: ^TaskLike, continuation: 'TResult1 -> TaskCode<'TOverall, 'TResult2>) : TaskCode<'TOverall, 'TResult2> = TaskCode<'TOverall, _>(fun sm -> if __useResumableCode then //-- RESUMABLE CODE START // Get an awaiter from the awaitable - let mutable awaiter = (^TaskLike: (member GetAwaiter: unit -> ^Awaiter) (task)) + let mutable awaiter = (^TaskLike: (member GetAwaiter: unit -> ^Awaiter) task) let mutable __stack_fin = true - if not (^Awaiter: (member get_IsCompleted: unit -> bool) (awaiter)) then + if not (^Awaiter: (member get_IsCompleted: unit -> bool) awaiter) then // This will yield with __stack_yield_fin = false // This will resume with __stack_yield_fin = true let __stack_yield_fin = ResumableCode.Yield().Invoke(&sm) __stack_fin <- __stack_yield_fin if __stack_fin then - let result = (^Awaiter: (member GetResult: unit -> 'TResult1) (awaiter)) + let result = (^Awaiter: (member GetResult: unit -> 'TResult1) awaiter) (continuation result).Invoke(&sm) else sm.Data.MethodBuilder.AwaitUnsafeOnCompleted(&awaiter, &sm) @@ -415,14 +415,14 @@ module HighPriority = type TaskBuilderBase with static member BindDynamic - (sm: byref<_>, task: Task<'TResult1>, continuation: ('TResult1 -> TaskCode<'TOverall, 'TResult2>)) + (sm: byref<_>, task: Task<'TResult1>, continuation: 'TResult1 -> TaskCode<'TOverall, 'TResult2>) : bool = let mutable awaiter = task.GetAwaiter() let cont = - (TaskResumptionFunc<'TOverall>(fun sm -> + TaskResumptionFunc<'TOverall>(fun sm -> let result = awaiter.GetResult() - (continuation result).Invoke(&sm))) + (continuation result).Invoke(&sm)) // shortcut to continue immediately if awaiter.IsCompleted then @@ -433,7 +433,7 @@ module HighPriority = false member inline _.Bind - (task: Task<'TResult1>, continuation: ('TResult1 -> TaskCode<'TOverall, 'TResult2>)) + (task: Task<'TResult1>, continuation: 'TResult1 -> TaskCode<'TOverall, 'TResult2>) : TaskCode<'TOverall, 'TResult2> = TaskCode<'TOverall, _>(fun sm -> @@ -500,7 +500,7 @@ module MediumPriority = type TaskBuilderBase with member inline this.Bind - (computation: Async<'TResult1>, continuation: ('TResult1 -> TaskCode<'TOverall, 'TResult2>)) + (computation: Async<'TResult1>, continuation: 'TResult1 -> TaskCode<'TOverall, 'TResult2>) : TaskCode<'TOverall, 'TResult2> = this.Bind(Async.StartImmediateAsTask computation, continuation) diff --git a/tests/FSharp.Compiler.Service.Tests/ExprTests.fs b/tests/FSharp.Compiler.Service.Tests/ExprTests.fs index b82eb062ef2..2508675108f 100644 --- a/tests/FSharp.Compiler.Service.Tests/ExprTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/ExprTests.fs @@ -3269,7 +3269,7 @@ let ``Test ProjectForWitnesses1 GetWitnessPassingInfo`` () = |> Option.map (fun su -> su.Symbol :?> FSharpMemberOrFunctionOrValue) |> Option.get printfn "symbol = %s" symbol.FullName - let wpi = (symbol.GetWitnessPassingInfo()) + let wpi = symbol.GetWitnessPassingInfo() match wpi with | None -> failwith "witness passing info expected" | Some (nm, argTypes) -> @@ -3288,7 +3288,7 @@ let ``Test ProjectForWitnesses1 GetWitnessPassingInfo`` () = |> Option.map (fun su -> su.Symbol :?> FSharpMemberOrFunctionOrValue) |> Option.get printfn "symbol = %s" symbol.FullName - let wpi = (symbol.GetWitnessPassingInfo()) + let wpi = symbol.GetWitnessPassingInfo() match wpi with | None -> failwith "witness passing info expected" | Some (nm, argTypes) -> @@ -3433,7 +3433,7 @@ let ``Test ProjectForWitnesses3 GetWitnessPassingInfo`` () = |> Option.map (fun su -> su.Symbol :?> FSharpMemberOrFunctionOrValue) |> Option.get printfn "symbol = %s" symbol.FullName - let wpi = (symbol.GetWitnessPassingInfo()) + let wpi = symbol.GetWitnessPassingInfo() match wpi with | None -> failwith "witness passing info expected" | Some (nm, argTypes) -> diff --git a/tests/FSharp.Compiler.Service.Tests/FSharpExprPatternsTests.fs b/tests/FSharp.Compiler.Service.Tests/FSharpExprPatternsTests.fs index 0c5c9fc3305..fd73b7e39a0 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharpExprPatternsTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/FSharpExprPatternsTests.fs @@ -146,7 +146,7 @@ let testPatterns handler source = |> Async.RunImmediate match checkResult with - | _, FSharpCheckFileAnswer.Succeeded (checkResults) -> + | _, FSharpCheckFileAnswer.Succeeded checkResults -> match checkResults.ImplementationFile with | Some implFile -> diff --git a/tests/FSharp.Compiler.Service.Tests/HashIfExpression.fs b/tests/FSharp.Compiler.Service.Tests/HashIfExpression.fs index d348f692aaa..2032b625f3e 100644 --- a/tests/FSharp.Compiler.Service.Tests/HashIfExpression.fs +++ b/tests/FSharp.Compiler.Service.Tests/HashIfExpression.fs @@ -98,7 +98,7 @@ type public HashIfExpression() = "DEBUG" , (IfdefId "DEBUG") "!DEBUG" , !! (IfdefId "DEBUG") "O_s1" , IfdefId "O_s1" - "(ONE)" , (ONE) + "(ONE)" , ONE "ONE&&TWO" , ONE &&& TWO "ONE||TWO" , ONE ||| TWO "( ONE && TWO )" , ONE &&& TWO diff --git a/tests/FSharp.Compiler.Service.Tests/ParserTests.fs b/tests/FSharp.Compiler.Service.Tests/ParserTests.fs index 2fc76220cd8..bf36e2755ef 100644 --- a/tests/FSharp.Compiler.Service.Tests/ParserTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/ParserTests.fs @@ -143,7 +143,7 @@ match () with b """ match getSingleModuleMemberDecls parseResults with - | [ SynModuleDecl.Expr (expr=(SynExpr.Match _ as m)); SynModuleDecl.Expr (expr=(SynExpr.Ident _ as i)) ] -> + | [ SynModuleDecl.Expr (expr=SynExpr.Match _ as m); SynModuleDecl.Expr (expr=SynExpr.Ident _ as i) ] -> Assert.True(Position.posLt m.Range.End i.Range.Start) | _ -> failwith "Unexpected tree" diff --git a/tests/FSharp.Compiler.Service.Tests/ProductVersion.fs b/tests/FSharp.Compiler.Service.Tests/ProductVersion.fs index 71272004cfa..d74d4d52b57 100644 --- a/tests/FSharp.Compiler.Service.Tests/ProductVersion.fs +++ b/tests/FSharp.Compiler.Service.Tests/ProductVersion.fs @@ -66,7 +66,7 @@ module ProductVersionTest = [] let ``should use values if valid major.minor.revision.build version format`` () = - for (v, expected) in validValues() do + for v, expected in validValues() do v |> ConvertProductVersionToILVersionInfo |> Assert.shouldBe expected let internal invalidValues () = @@ -84,5 +84,5 @@ module ProductVersionTest = [] let ``should zero starting from first invalid version part`` () = - for (v, expected) in invalidValues() do + for v, expected in invalidValues() do v |> ConvertProductVersionToILVersionInfo |> Assert.shouldBe expected diff --git a/tests/FSharp.Compiler.Service.Tests/ProjectAnalysisTests.fs b/tests/FSharp.Compiler.Service.Tests/ProjectAnalysisTests.fs index c4261eaeab3..2ecdc4fefb7 100644 --- a/tests/FSharp.Compiler.Service.Tests/ProjectAnalysisTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/ProjectAnalysisTests.fs @@ -4437,7 +4437,7 @@ module internal Project34 = // i.e. the private type System.Data.Listeners may not be available on Mono. yield @"-r:" + (__SOURCE_DIRECTORY__ ++ ".." ++ "service" ++ "data" ++ "System.Data.dll") |] - |> Array.filter(fun arg -> not((arg.Contains("System.Data")) && not (arg.Contains(@"service\data\System.Data.dll")))) + |> Array.filter(fun arg -> not(arg.Contains("System.Data") && not (arg.Contains(@"service\data\System.Data.dll")))) let options = { checker.GetProjectOptionsFromCommandLineArgs (projFileName, args) with SourceFiles = fileNames } diff --git a/tests/FSharp.Compiler.Service.Tests/ScriptOptionsTests.fs b/tests/FSharp.Compiler.Service.Tests/ScriptOptionsTests.fs index 43dfe12a0c0..fd6b868de08 100644 --- a/tests/FSharp.Compiler.Service.Tests/ScriptOptionsTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/ScriptOptionsTests.fs @@ -42,7 +42,7 @@ let ``can generate options for different frameworks regardless of execution envi //[] [] [] -let ``can resolve nuget packages to right target framework for different frameworks regardless of execution environment``(flag) = +let ``can resolve nuget packages to right target framework for different frameworks regardless of execution environment`` flag = let dir = DirectoryInfo(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location)) let file = (getTemporaryFileNameInDirectory dir) + ".fsx" let scriptFullPath = Path.Combine(dir.FullName, file) diff --git a/tests/FSharp.Compiler.Service.Tests/ServiceUntypedParseTests.fs b/tests/FSharp.Compiler.Service.Tests/ServiceUntypedParseTests.fs index 51be9f0c058..c6711965e72 100644 --- a/tests/FSharp.Compiler.Service.Tests/ServiceUntypedParseTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/ServiceUntypedParseTests.fs @@ -89,10 +89,10 @@ type T = module AttributeConstructorCompletion = [] - [] - [] - [][] - [] + [] + [] + [][] + [] let ``incomplete``(lineStr: string) = let code = $""" {lineStr} @@ -102,11 +102,11 @@ type T = code |> assertCompletionContext (fun x -> match x with Some (CompletionContext.ParameterList _) -> true | _ -> false) [] - []")>] - [][]")>] - []")>] - []")>] - [][]")>] + []">] + [][]">] + []">] + []">] + [][]">] let ``complete``(lineStr: string) = let code = $""" {lineStr} From 56b60b3261d484bdc796f42df7bbcde9e1c57782 Mon Sep 17 00:00:00 2001 From: Eugene Auduchinok Date: Wed, 15 Oct 2025 14:57:18 +0200 Subject: [PATCH 6/6] Fantomas --- src/Compiler/AbstractIL/il.fs | 3 +- src/Compiler/Driver/CreateILModule.fs | 2 +- src/Compiler/Interactive/fsi.fs | 34 ++++++++++---------- src/Compiler/Service/FSharpWorkspaceState.fs | 2 +- src/Compiler/Service/TransparentCompiler.fsi | 6 +--- src/FSharp.Core/array.fs | 4 +-- src/FSharp.Core/quotations.fs | 3 +- src/FSharp.Core/reflect.fs | 4 +-- src/FSharp.Core/seq.fsi | 4 +-- 9 files changed, 27 insertions(+), 35 deletions(-) diff --git a/src/Compiler/AbstractIL/il.fs b/src/Compiler/AbstractIL/il.fs index b93340584db..5d7848f246e 100644 --- a/src/Compiler/AbstractIL/il.fs +++ b/src/Compiler/AbstractIL/il.fs @@ -2361,8 +2361,7 @@ type ILPropertyDef | Some attrs -> attrs) ) - member x.IsSpecialName = - (x.Attributes &&& PropertyAttributes.SpecialName) <> enum<_> 0 + member x.IsSpecialName = (x.Attributes &&& PropertyAttributes.SpecialName) <> enum<_> 0 member x.IsRTSpecialName = (x.Attributes &&& PropertyAttributes.RTSpecialName) <> enum<_> 0 diff --git a/src/Compiler/Driver/CreateILModule.fs b/src/Compiler/Driver/CreateILModule.fs index 81889b958e3..67d7861c81f 100644 --- a/src/Compiler/Driver/CreateILModule.fs +++ b/src/Compiler/Driver/CreateILModule.fs @@ -632,7 +632,7 @@ module MainModuleBuilder = ManifestResourceFormat.VS_MANIFEST_RESOURCE( FileSystem.OpenFileForReadShim(win32Manifest).ReadAllBytes(), tcConfig.target = CompilerTarget.Dll - ) + ) |] if String.IsNullOrEmpty(tcConfig.win32res) diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index b49c0f83db9..f077682178e 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -909,7 +909,8 @@ type internal DiagnosticsLoggerThatStopsOnFirstError exit 1 (* non-zero exit code *) // STOP ON FIRST ERROR (AVOIDS PARSER ERROR RECOVERY) raise StopProcessing - | FSharpDiagnosticSeverity.Warning | FSharpDiagnosticSeverity.Info as adjustedSeverity -> + | FSharpDiagnosticSeverity.Warning + | FSharpDiagnosticSeverity.Info as adjustedSeverity -> DoWithDiagnosticColor adjustedSeverity (fun () -> fsiConsoleOutput.Error.WriteLine() diagnostic.WriteWithContext(fsiConsoleOutput.Error, " ", fsiStdinSyphon.GetLine, tcConfig, severity) @@ -1446,24 +1447,24 @@ type internal FsiConsoleInput if fsiOptions.Interact then if fsiOptions.PeekAheadOnConsoleToPermitTyping then Thread(fun () -> - match consoleOpt with - | Some console when fsiOptions.EnableConsoleKeyProcessing && not fsiOptions.UseServerPrompt -> - if List.isEmpty fsiOptions.SourceFiles then - if progress then - fprintfn outWriter "first-line-reader-thread reading first line..." + match consoleOpt with + | Some console when fsiOptions.EnableConsoleKeyProcessing && not fsiOptions.UseServerPrompt -> + if List.isEmpty fsiOptions.SourceFiles then + if progress then + fprintfn outWriter "first-line-reader-thread reading first line..." - firstLine <- Some(console ()) + firstLine <- Some(console ()) - if progress then - fprintfn outWriter "first-line-reader-thread got first line = %A..." firstLine + if progress then + fprintfn outWriter "first-line-reader-thread got first line = %A..." firstLine - consoleReaderStartupDone.Set() |> ignore + consoleReaderStartupDone.Set() |> ignore - if progress then - fprintfn outWriter "first-line-reader-thread has set signal and exited." - | _ -> - ignore (inReader.Peek()) - consoleReaderStartupDone.Set() |> ignore) + if progress then + fprintfn outWriter "first-line-reader-thread has set signal and exited." + | _ -> + ignore (inReader.Peek()) + consoleReaderStartupDone.Set() |> ignore) .Start() else if progress then @@ -1613,8 +1614,7 @@ let rec ConvReflectionTypeToILType (reflectionTy: Type) = let internal mkBoundValueTypedImpl tcGlobals m moduleName name ty = let vis = Accessibility.TAccess([]) - let compPath = - CompilationPath.CompPath(ILScopeRef.Local, SyntaxAccess.Unknown, []) + let compPath = CompilationPath.CompPath(ILScopeRef.Local, SyntaxAccess.Unknown, []) let mutable mty = Unchecked.defaultof<_> diff --git a/src/Compiler/Service/FSharpWorkspaceState.fs b/src/Compiler/Service/FSharpWorkspaceState.fs index 348e64b2259..6da03697db8 100644 --- a/src/Compiler/Service/FSharpWorkspaceState.fs +++ b/src/Compiler/Service/FSharpWorkspaceState.fs @@ -343,7 +343,7 @@ type FSharpWorkspaceProjects internal (depGraph: IThreadSafeDependencyGraph<_, _ s.OutputFileName |> Option.defaultWith (fun () -> failwith "project doesn't have output filename"), s - )) + )) |> Seq.toList projectConfig, referencedProjects) diff --git a/src/Compiler/Service/TransparentCompiler.fsi b/src/Compiler/Service/TransparentCompiler.fsi index e01ad596eb3..2eb1786dc74 100644 --- a/src/Compiler/Service/TransparentCompiler.fsi +++ b/src/Compiler/Service/TransparentCompiler.fsi @@ -155,11 +155,7 @@ type internal CompilerCaches = member ParseAndCheckAllFilesInProject: AsyncMemoizeDisabled member ParseAndCheckFileInProject: - AsyncMemoize< - string * FSharpProjectIdentifier, - string * string, - FSharpParseFileResults * FSharpCheckFileAnswer - > + AsyncMemoize member ParseAndCheckProject: AsyncMemoize diff --git a/src/FSharp.Core/array.fs b/src/FSharp.Core/array.fs index cc1a0babc66..aa58e080e73 100644 --- a/src/FSharp.Core/array.fs +++ b/src/FSharp.Core/array.fs @@ -2523,9 +2523,7 @@ module Array = // Here we enforce nan=nan equality to prevent throwing if typeof<'Key> = typeof || typeof<'Key> = typeof then let genericCmp = - HashIdentity.FromFunctions<'Key> - LanguagePrimitives.GenericHash - LanguagePrimitives.GenericEqualityER + HashIdentity.FromFunctions<'Key> LanguagePrimitives.GenericHash LanguagePrimitives.GenericEqualityER groupByImplParallel genericCmp keyf id array else diff --git a/src/FSharp.Core/quotations.fs b/src/FSharp.Core/quotations.fs index a69e669681b..4ac472877e2 100644 --- a/src/FSharp.Core/quotations.fs +++ b/src/FSharp.Core/quotations.fs @@ -2847,7 +2847,8 @@ module DerivedPatterns = let (|SpecificCall|_|) templateParameter = // Note: precomputation match templateParameter with - | Lambdas(_, Call(_, minfo1, _)) | Call(_, minfo1, _) -> + | Lambdas(_, Call(_, minfo1, _)) + | Call(_, minfo1, _) -> let isg1 = minfo1.IsGenericMethod let gmd = diff --git a/src/FSharp.Core/reflect.fs b/src/FSharp.Core/reflect.fs index 3290ec8a278..02a1b7c62e1 100644 --- a/src/FSharp.Core/reflect.fs +++ b/src/FSharp.Core/reflect.fs @@ -1476,9 +1476,7 @@ module FSharpReflectionExtensions = let bindingFlags = getBindingFlags allowAccessToPrivateRepresentation FSharpValue.GetUnionFields(value, unionType, bindingFlags) - static member PreComputeUnionTagReader - (unionType: Type, ?allowAccessToPrivateRepresentation) - : objnull -> int = + static member PreComputeUnionTagReader(unionType: Type, ?allowAccessToPrivateRepresentation) : objnull -> int = let bindingFlags = getBindingFlags allowAccessToPrivateRepresentation FSharpValue.PreComputeUnionTagReader(unionType, bindingFlags) diff --git a/src/FSharp.Core/seq.fsi b/src/FSharp.Core/seq.fsi index 526becf4dd1..8aedfa6ff6d 100644 --- a/src/FSharp.Core/seq.fsi +++ b/src/FSharp.Core/seq.fsi @@ -84,7 +84,7 @@ module Seq = /// [] val inline average: - source: seq<^T> -> ^T + source: seq< ^T > -> ^T when ^T: (static member (+): ^T * ^T -> ^T) and ^T: (static member DivideByInt: ^T * int -> ^T) and ^T: (static member Zero: ^T) @@ -2346,7 +2346,7 @@ module Seq = /// Evaluates to 11. /// [] - val inline sum: source: seq<^T> -> ^T when ^T: (static member (+): ^T * ^T -> ^T) and ^T: (static member Zero: ^T) + val inline sum: source: seq< ^T > -> ^T when ^T: (static member (+): ^T * ^T -> ^T) and ^T: (static member Zero: ^T) /// Returns the sum of the results generated by applying the function to each element of the sequence. ///