diff --git a/fcs/docsrc/content/filesystem.fsx b/fcs/docsrc/content/filesystem.fsx index 6c4d973d497..ad0a57712b9 100644 --- a/fcs/docsrc/content/filesystem.fsx +++ b/fcs/docsrc/content/filesystem.fsx @@ -41,7 +41,7 @@ let B = File1.A + File1.A""" interface IFileSystem with // Implement the service to open files for reading and writing member __.FileStreamReadShim(fileName) = - match files.TryGetValue(fileName) with + match files.TryGetValue fileName with | true, text -> new MemoryStream(Encoding.UTF8.GetBytes(text)) :> Stream | _ -> defaultFileSystem.FileStreamReadShim(fileName) @@ -52,7 +52,7 @@ let B = File1.A + File1.A""" defaultFileSystem.FileStreamWriteExistingShim(fileName) member __.ReadAllBytesShim(fileName) = - match files.TryGetValue(fileName) with + match files.TryGetValue fileName with | true, text -> Encoding.UTF8.GetBytes(text) | _ -> defaultFileSystem.ReadAllBytesShim(fileName) diff --git a/fcs/docsrc/content/ja/filesystem.fsx b/fcs/docsrc/content/ja/filesystem.fsx index 6a75cb61961..0680f34122f 100644 --- a/fcs/docsrc/content/ja/filesystem.fsx +++ b/fcs/docsrc/content/ja/filesystem.fsx @@ -41,7 +41,7 @@ let B = File1.A + File1.A""" interface IFileSystem with // 読み取りおよび書き込み用にファイルをオープンする機能を実装 member __.FileStreamReadShim(fileName) = - match files.TryGetValue(fileName) with + match files.TryGetValue fileName with | true, text -> new MemoryStream(Encoding.UTF8.GetBytes(text)) :> Stream | _ -> defaultFileSystem.FileStreamReadShim(fileName) @@ -55,7 +55,7 @@ let B = File1.A + File1.A""" defaultFileSystem.FileStreamWriteExistingShim(fileName) member __.ReadAllBytesShim(fileName) = - match files.TryGetValue(fileName) with + match files.TryGetValue fileName with | true, text -> Encoding.UTF8.GetBytes(text) | _ -> defaultFileSystem.ReadAllBytesShim(fileName) diff --git a/src/absil/illib.fs b/src/absil/illib.fs index d0052c08da2..fea0fd92a97 100644 --- a/src/absil/illib.fs +++ b/src/absil/illib.fs @@ -985,15 +985,13 @@ type MemoizationTable<'T, 'U>(compute: 'T -> 'U, keyComparer: IEqualityComparer< member t.Apply x = if (match canMemoize with None -> true | Some f -> f x) then - let mutable res = Unchecked.defaultof<'U> - let ok = table.TryGetValue(x, &res) - if ok then res - else + match table.TryGetValue x with + | true, res -> res + | _ -> lock table (fun () -> - let mutable res = Unchecked.defaultof<'U> - let ok = table.TryGetValue(x, &res) - if ok then res - else + match table.TryGetValue x with + | true, res -> res + | _ -> let res = compute x table.[x] <- res res) @@ -1074,11 +1072,10 @@ module Tables = let memoize f = let t = new Dictionary<_, _>(1000, HashIdentity.Structural) fun x -> - let mutable res = Unchecked.defaultof<_> - if t.TryGetValue(x, &res) then - res - else - res <- f x + match t.TryGetValue x with + | true, res -> res + | _ -> + let res = f x t.[x] <- res res diff --git a/src/absil/ilread.fs b/src/absil/ilread.fs index 9828d95215c..280bbf0c384 100644 --- a/src/absil/ilread.fs +++ b/src/absil/ilread.fs @@ -903,12 +903,11 @@ let mkCacheInt32 lowMem _inbase _nm _sz = | null -> cache := new Dictionary(11) | _ -> () !cache - let mutable res = Unchecked.defaultof<_> - let ok = cache.TryGetValue(idx, &res) - if ok then + match cache.TryGetValue idx with + | true, res -> incr count res - else + | _ -> let res = f idx cache.[idx] <- res res @@ -4048,7 +4047,7 @@ let OpenILModuleReader fileName opts = let cacheResult2 = // can't used a cached entry when reading PDBs, since it makes the returned object IDisposable if keyOk && opts.pdbDirPath.IsNone then - ilModuleReaderCache2.TryGetValue(key) + ilModuleReaderCache2.TryGetValue key else false, Unchecked.defaultof<_> diff --git a/src/absil/ilwrite.fs b/src/absil/ilwrite.fs index 04cab418461..65904d2aa5d 100644 --- a/src/absil/ilwrite.fs +++ b/src/absil/ilwrite.fs @@ -464,10 +464,9 @@ type MetadataTable<'T> = #if DEBUG tbl.lookups <- tbl.lookups + 1 #endif - let mutable res = Unchecked.defaultof<_> - let ok = tbl.dict.TryGetValue(x, &res) - if ok then res - else tbl.AddSharedEntry x + match tbl.dict.TryGetValue x with + | true, res -> res + | _ -> tbl.AddSharedEntry x /// This is only used in one special place - see further below. @@ -769,11 +768,12 @@ let rec GetTypeRefAsTypeRefRow cenv (tref: ILTypeRef) = SharedRow [| ResolutionScope (rs1, rs2); nelem; nselem |] and GetTypeRefAsTypeRefIdx cenv tref = - let mutable res = 0 - if cenv.trefCache.TryGetValue(tref, &res) then res else - let res = FindOrAddSharedRow cenv TableNames.TypeRef (GetTypeRefAsTypeRefRow cenv tref) - cenv.trefCache.[tref] <- res - res + match cenv.trefCache.TryGetValue tref with + | true, res -> res + | _ -> + let res = FindOrAddSharedRow cenv TableNames.TypeRef (GetTypeRefAsTypeRefRow cenv tref) + cenv.trefCache.[tref] <- res + res and GetTypeDescAsTypeRefIdx cenv (scoref, enc, n) = GetTypeRefAsTypeRefIdx cenv (mkILNestedTyRef (scoref, enc, n)) diff --git a/src/fsharp/AttributeChecking.fs b/src/fsharp/AttributeChecking.fs index e9eceef9b9a..07ac05faa82 100644 --- a/src/fsharp/AttributeChecking.fs +++ b/src/fsharp/AttributeChecking.fs @@ -513,7 +513,7 @@ let IsSecurityAttribute (g: TcGlobals) amap (casmap : Dictionary) ( match attr.TyconRef.TryDeref with | ValueSome _ -> let tcs = tcref.Stamp - match casmap.TryGetValue(tcs) with + match casmap.TryGetValue tcs with | true, c -> c | _ -> let exists = ExistsInEntireHierarchyOfType (fun t -> typeEquiv g t (mkAppTy attr.TyconRef [])) g amap m AllowMultiIntfInstantiations.Yes (mkAppTy tcref []) diff --git a/src/fsharp/ExtensionTyping.fs b/src/fsharp/ExtensionTyping.fs index fddfdc65d44..9f58399d333 100755 --- a/src/fsharp/ExtensionTyping.fs +++ b/src/fsharp/ExtensionTyping.fs @@ -336,16 +336,18 @@ module internal ExtensionTyping = match ctxt with | NoEntries -> None | Entries(d, _) -> - let mutable res = Unchecked.defaultof<_> - if d.TryGetValue(st, &res) then Some res else None + match d.TryGetValue st with + | true, res -> Some res + | _ -> None member ctxt.TryGetTyconRef st = match ctxt with | NoEntries -> None | Entries(_, d) -> let d = d.Force() - let mutable res = Unchecked.defaultof<_> - if d.TryGetValue(st, &res) then Some res else None + match d.TryGetValue st with + | true, res -> Some res + | _ -> None member ctxt.RemapTyconRefs (f: obj->obj) = match ctxt with diff --git a/src/fsharp/InfoReader.fs b/src/fsharp/InfoReader.fs index 8176e4119a1..7e9dffdd52b 100644 --- a/src/fsharp/InfoReader.fs +++ b/src/fsharp/InfoReader.fs @@ -107,7 +107,7 @@ type PropertyCollector(g, amap, m, ty, optFilter, ad) = let props = new Dictionary(hashIdentity) let add pinfo = - match props.TryGetValue(pinfo), pinfo with + match props.TryGetValue pinfo, pinfo with | (true, FSProp (_, ty, Some vref1, _)), FSProp (_, _, _, Some vref2) | (true, FSProp (_, ty, _, Some vref2)), FSProp (_, _, Some vref1, _) -> let pinfo = FSProp (g, ty, Some vref1, Some vref2) diff --git a/src/fsharp/MethodCalls.fs b/src/fsharp/MethodCalls.fs index 2f8fd8bbbc3..912a4035280 100644 --- a/src/fsharp/MethodCalls.fs +++ b/src/fsharp/MethodCalls.fs @@ -725,7 +725,7 @@ let TryImportProvidedMethodBaseAsLibraryIntrinsic (amap: Import.ImportMap, m: ra match amap.g.knownIntrinsics.TryGetValue ((declaringEntity.LogicalName, methodName)) with | true, vref -> Some vref | _ -> - match amap.g.knownFSharpCoreModules.TryGetValue(declaringEntity.LogicalName) with + match amap.g.knownFSharpCoreModules.TryGetValue declaringEntity.LogicalName with | true, modRef -> modRef.ModuleOrNamespaceType.AllValsByLogicalName |> Seq.tryPick (fun (KeyValue(_, v)) -> if v.CompiledName = methodName then Some (mkNestedValRef modRef v) else None) @@ -1219,7 +1219,7 @@ module ProvidedMethodCalls = // sub in the appropriate argument // REVIEW: "thisArg" pointer should be first, if present let vRaw = pe.PUntaint(id, m) - match varConv.TryGetValue(vRaw) with + match varConv.TryGetValue vRaw with | true, v -> v | _ -> let typeProviderDesignation = ExtensionTyping.DisplayNameOfTypeProvider (pe.TypeProvider, m) diff --git a/src/fsharp/Optimizer.fs b/src/fsharp/Optimizer.fs index b94cedf9625..226c87d3b2b 100644 --- a/src/fsharp/Optimizer.fs +++ b/src/fsharp/Optimizer.fs @@ -573,18 +573,18 @@ let GetInfoForLocalValue cenv env (v: Val) m = // Abstract slots do not have values if v.IsDispatchSlot then UnknownValInfo else - let mutable res = Unchecked.defaultof<_> - let ok = cenv.localInternalVals.TryGetValue(v.Stamp, &res) - if ok then res else - match env.localExternalVals.TryFind v.Stamp with - | Some vval -> vval - | None -> - if v.MustInline then - errorR(Error(FSComp.SR.optValueMarkedInlineButWasNotBoundInTheOptEnv(fullDisplayTextOfValRef (mkLocalValRef v)), m)) + match cenv.localInternalVals.TryGetValue v.Stamp with + | true, res -> res + | _ -> + match env.localExternalVals.TryFind v.Stamp with + | Some vval -> vval + | None -> + if v.MustInline then + errorR(Error(FSComp.SR.optValueMarkedInlineButWasNotBoundInTheOptEnv(fullDisplayTextOfValRef (mkLocalValRef v)), m)) #if CHECKED - warning(Error(FSComp.SR.optLocalValueNotFoundDuringOptimization(v.DisplayName), m)) + warning(Error(FSComp.SR.optLocalValueNotFoundDuringOptimization(v.DisplayName), m)) #endif - UnknownValInfo + UnknownValInfo let TryGetInfoForCcu env (ccu: CcuThunk) = env.globalModuleInfos.TryFind(ccu.AssemblyName) diff --git a/src/fsharp/PostInferenceChecks.fs b/src/fsharp/PostInferenceChecks.fs index 521d623a4e9..6ca98745cec 100644 --- a/src/fsharp/PostInferenceChecks.fs +++ b/src/fsharp/PostInferenceChecks.fs @@ -211,7 +211,7 @@ let IsValLocal env (v: Val) = /// Get the limit of the val. let GetLimitVal cenv env m (v: Val) = let limit = - match cenv.limitVals.TryGetValue(v.Stamp) with + match cenv.limitVals.TryGetValue v.Stamp with | true, limit -> limit | _ -> if IsValLocal env v then diff --git a/src/fsharp/TastPickle.fs b/src/fsharp/TastPickle.fs index 6bb5dacaccd..6b548ef7b1b 100644 --- a/src/fsharp/TastPickle.fs +++ b/src/fsharp/TastPickle.fs @@ -71,9 +71,9 @@ type Table<'T> = tbl.rows.Add x n member tbl.FindOrAdd x = - let mutable res = Unchecked.defaultof<_> - let ok = tbl.tbl.TryGetValue(x, &res) - if ok then res else tbl.Add x + match tbl.tbl.TryGetValue x with + | true, res -> res + | _ -> tbl.Add x static member Create n = diff --git a/src/fsharp/TcGlobals.fs b/src/fsharp/TcGlobals.fs index aa9a052ed63..376cd0d3c8b 100755 --- a/src/fsharp/TcGlobals.fs +++ b/src/fsharp/TcGlobals.fs @@ -870,9 +870,9 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d TType_app (tcref, tinst) else let dict = getDecompileTypeDict() - let mutable builder = Unchecked.defaultof<_> - if dict.TryGetValue(tcref.Stamp, &builder) then builder tinst - else TType_app (tcref, tinst) + match dict.TryGetValue tcref.Stamp with + | true, builder -> builder tinst + | _ -> TType_app (tcref, tinst) /// For cosmetic purposes "improve" some .NET types, e.g. Int32 --> int32. /// Doing this normalization is a fairly performance critical piece of code as it is frequently invoked @@ -880,14 +880,14 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d let improveTy (tcref: EntityRef) tinst = if compilingFslib then let dict = getBetterTypeDict1() - let mutable builder = Unchecked.defaultof<_> - if dict.TryGetValue(tcref.LogicalName, &builder) then builder tcref tinst - else TType_app (tcref, tinst) + match dict.TryGetValue tcref.LogicalName with + | true, builder -> builder tcref tinst + | _ -> TType_app (tcref, tinst) else let dict = getBetterTypeDict2() - let mutable builder = Unchecked.defaultof<_> - if dict.TryGetValue(tcref.Stamp, &builder) then builder tinst - else TType_app (tcref, tinst) + match dict.TryGetValue tcref.Stamp with + | true, builder -> builder tinst + | _ -> TType_app (tcref, tinst) override x.ToString() = "" diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index 3add36732fa..5da1e9325a2 100644 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -12394,8 +12394,8 @@ module TcRecdUnionAndEnumDeclarations = begin let ValidateFieldNames (synFields: SynField list, tastFields: RecdField list) = let seen = Dictionary() for (sf, f) in List.zip synFields tastFields do - let mutable synField = Unchecked.defaultof<_> - if seen.TryGetValue(f.Name, &synField) then + match seen.TryGetValue f.Name with + | true, synField -> match sf, synField with | Field(_, _, Some id, _, _, _, _, _), Field(_, _, Some(_), _, _, _, _, _) -> error(Error(FSComp.SR.tcFieldNameIsUsedModeThanOnce(id.idText), id.idRange)) @@ -12403,7 +12403,7 @@ module TcRecdUnionAndEnumDeclarations = begin | Field(_, _, None, _, _, _, _, _), Field(_, _, Some id, _, _, _, _, _) -> error(Error(FSComp.SR.tcFieldNameConflictsWithGeneratedNameForAnonymousField(id.idText), id.idRange)) | _ -> assert false - else + | _ -> seen.Add(f.Name, sf) let TcUnionCaseDecl cenv env parent thisTy tpenv (UnionCase (synAttrs, id, args, xmldoc, vis, m)) = diff --git a/src/fsharp/fsi/fsi.fs b/src/fsharp/fsi/fsi.fs index 34a7ca0fc30..52dc674073e 100644 --- a/src/fsharp/fsi/fsi.fs +++ b/src/fsharp/fsi/fsi.fs @@ -1887,7 +1887,7 @@ type internal FsiInteractionProcessor if tcConfig.shadowCopyReferences then let resolvedPath = ar.resolvedPath.ToUpperInvariant() let fileTime = File.GetLastWriteTimeUtc(resolvedPath) - match referencedAssemblies.TryGetValue(resolvedPath) with + match referencedAssemblies.TryGetValue resolvedPath with | false, _ -> referencedAssemblies.Add(resolvedPath, fileTime) FSIstrings.SR.fsiDidAHashr(ar.resolvedPath) diff --git a/src/fsharp/import.fs b/src/fsharp/import.fs index 3c846229450..f6063ec6b41 100644 --- a/src/fsharp/import.fs +++ b/src/fsharp/import.fs @@ -134,7 +134,7 @@ let ImportILTypeRefUncached (env: ImportMap) m (tref: ILTypeRef) = /// Import a reference to a type definition, given an AbstractIL ILTypeRef, with caching let ImportILTypeRef (env: ImportMap) m (tref: ILTypeRef) = - match env.ILTypeRefToTyconRefCache.TryGetValue(tref) with + match env.ILTypeRefToTyconRefCache.TryGetValue tref with | true, tcref -> tcref | _ -> let tcref = ImportILTypeRefUncached env m tref @@ -436,7 +436,7 @@ let multisetDiscriminateAndMap nodef tipf (items: ('Key list * 'Value) list) = | [] -> () | key :: rest -> buckets.[key] <- - match buckets.TryGetValue(key) with + match buckets.TryGetValue key with | true, b -> (rest, v) :: b | _ -> (rest, v) :: [] diff --git a/src/fsharp/lexhelp.fs b/src/fsharp/lexhelp.fs index 615bf736f73..3d2db02c78d 100644 --- a/src/fsharp/lexhelp.fs +++ b/src/fsharp/lexhelp.fs @@ -43,12 +43,13 @@ type LightSyntaxStatus(initial:bool,warn:bool) = type LexResourceManager() = let strings = new System.Collections.Generic.Dictionary(1024) member x.InternIdentifierToken(s) = - let mutable res = Unchecked.defaultof<_> - let ok = strings.TryGetValue(s, &res) - if ok then res else - let res = IDENT s - (strings.[s] <- res; res) - + match strings.TryGetValue s with + | true, res -> res + | _ -> + let res = IDENT s + strings.[s] <- res + res + /// Lexer parameters type lexargs = { defines: string list diff --git a/src/fsharp/range.fs b/src/fsharp/range.fs index c393b31ead2..572cfae9d24 100755 --- a/src/fsharp/range.fs +++ b/src/fsharp/range.fs @@ -146,13 +146,13 @@ type FileIndexTable() = // // TO move forward we should eventually introduce a new type NormalizedFileName that tracks this invariant. member t.FileToIndex normalize filePath = - match fileToIndexTable.TryGetValue(filePath) with + match fileToIndexTable.TryGetValue filePath with | true, idx -> idx | _ -> // Try again looking for a normalized entry. let normalizedFilePath = if normalize then normalizeFilePath filePath else filePath - match fileToIndexTable.TryGetValue(normalizedFilePath) with + match fileToIndexTable.TryGetValue normalizedFilePath with | true, idx -> // Record the non-normalized entry if necessary if filePath <> normalizedFilePath then diff --git a/src/fsharp/tast.fs b/src/fsharp/tast.fs index 33fffda0a26..98a8710afb0 100644 --- a/src/fsharp/tast.fs +++ b/src/fsharp/tast.fs @@ -4060,7 +4060,7 @@ and [] AnonRecdTypeInfo = /// Get the ILTypeRef for the generated type implied by the anonymous type member x.ILTypeRef = - let ilTypeName = sprintf "<>f__AnonymousType%s%u`%d'" (match x.TupInfo with TupInfo.Const b -> if b then "1000" else "") (uint32 x.Stamp) x.SortedIds.Length + let ilTypeName = sprintf "<>f__AnonymousType%s%u`%d" (match x.TupInfo with TupInfo.Const b -> if b then "1000" else "") (uint32 x.Stamp) x.SortedIds.Length mkILTyRef(x.Assembly.ILScopeRef, ilTypeName) static member NewUnlinked() : AnonRecdTypeInfo = diff --git a/src/ilx/EraseUnions.fs b/src/ilx/EraseUnions.fs index 46756255018..1d0175676c8 100644 --- a/src/ilx/EraseUnions.fs +++ b/src/ilx/EraseUnions.fs @@ -587,9 +587,9 @@ let emitDataSwitch ilg (cg: ICodeGen<'Mark>) (avoidHelpers, cuspec, cases) = for (i,case) in cases do dict.[i] <- case let failLab = cg.GenerateDelayMark () let emitCase i _ = - let mutable res = Unchecked.defaultof<_> - let ok = dict.TryGetValue(i, &res) - if ok then res else cg.CodeLabel failLab + match dict.TryGetValue i with + | true, res -> res + | _ -> cg.CodeLabel failLab let dests = Array.mapi emitCase cuspec.AlternativesArray cg.EmitInstrs (mkGetTag ilg cuspec) diff --git a/src/utils/HashMultiMap.fs b/src/utils/HashMultiMap.fs index 8c0b0b1dfb9..7f571c232d0 100644 --- a/src/utils/HashMultiMap.fs +++ b/src/utils/HashMultiMap.fs @@ -22,15 +22,15 @@ type internal HashMultiMap<'Key,'Value>(n: int, hasheq: IEqualityComparer<'Key>) then seq |> Seq.iter (fun (k,v) -> x.Add(k,v)) member x.GetRest(k) = - let mutable res = [] - let ok = rest.TryGetValue(k,&res) - if ok then res else [] + match rest.TryGetValue k with + | true, res -> res + | _ -> [] member x.Add(y,z) = - let mutable res = Unchecked.defaultof<'Value> - let ok = firstEntries.TryGetValue(y,&res) - if ok then + match firstEntries.TryGetValue y with + | true, res -> rest.[y] <- res :: x.GetRest(y) + | _ -> () firstEntries.[y] <- z member x.Clear() = @@ -52,16 +52,16 @@ type internal HashMultiMap<'Key,'Value>(n: int, hasheq: IEqualityComparer<'Key>) member x.Item with get(y : 'Key) = - let mutable res = Unchecked.defaultof<'Value> - let ok = firstEntries.TryGetValue(y,&res) - if ok then res else raise (KeyNotFoundException("The item was not found in collection")) + match firstEntries.TryGetValue y with + | true, res -> res + | _ -> raise (KeyNotFoundException("The item was not found in collection")) and set (y:'Key) (z:'Value) = x.Replace(y,z) member x.FindAll(y) = - let mutable res = Unchecked.defaultof<'Value> - let ok = firstEntries.TryGetValue(y,&res) - if ok then res :: x.GetRest(y) else [] + match firstEntries.TryGetValue y with + | true, res -> res :: x.GetRest(y) + | _ -> [] member x.Fold f acc = let mutable res = acc @@ -88,14 +88,12 @@ type internal HashMultiMap<'Key,'Value>(n: int, hasheq: IEqualityComparer<'Key>) member x.ContainsKey(y) = firstEntries.ContainsKey(y) member x.Remove(y) = - let mutable res = Unchecked.defaultof<'Value> - let ok = firstEntries.TryGetValue(y,&res) + match firstEntries.TryGetValue y with // NOTE: If not ok then nothing to remove - nop - if ok then + | true, _res -> // We drop the FirstEntry. Here we compute the new FirstEntry and residue MoreEntries - let mutable res = [] - let ok = rest.TryGetValue(y,&res) - if ok then + match rest.TryGetValue y with + | true, res -> match res with | [h] -> firstEntries.[y] <- h; @@ -105,16 +103,17 @@ type internal HashMultiMap<'Key,'Value>(n: int, hasheq: IEqualityComparer<'Key>) rest.[y] <- t | _ -> () - else + | _ -> firstEntries.Remove(y) |> ignore + | _ -> () member x.Replace(y,z) = firstEntries.[y] <- z member x.TryFind(y) = - let mutable res = Unchecked.defaultof<'Value> - let ok = firstEntries.TryGetValue(y,&res) - if ok then Some(res) else None + match firstEntries.TryGetValue y with + | true, res -> Some res + | _ -> None member x.Count = firstEntries.Count diff --git a/src/utils/reshapedmsbuild.fs b/src/utils/reshapedmsbuild.fs index 657b7ed0d94..75859f44765 100644 --- a/src/utils/reshapedmsbuild.fs +++ b/src/utils/reshapedmsbuild.fs @@ -369,7 +369,7 @@ module internal ToolLocationHelper = // Doesn't need to be virtual @@@@@ abstract member GetPathToDotNetFramework: DotNetFrameworkArchitecture -> string default this.GetPathToDotNetFramework arch = - match this.pathsToDotNetFramework.TryGetValue(arch) with + match this.pathsToDotNetFramework.TryGetValue arch with | true, x -> x | _ -> if not (CheckForFrameworkInstallation this.dotNetFrameworkRegistryKey this.dotNetFrameworkSetupRegistryInstalledName) then null @@ -766,7 +766,7 @@ module internal ToolLocationHelper = array.ToDictionary(fun spec -> spec.Version) let getDotNetFrameworkSpec version = - match dotNetFrameworkSpecDict.TryGetValue(version) with + match dotNetFrameworkSpecDict.TryGetValue version with | true, x -> x | _ -> raise (getArgumentException version) diff --git a/tests/fsharp/core/csext/test.fsx b/tests/fsharp/core/csext/test.fsx index cfe0ec3759f..8e3793e634c 100644 --- a/tests/fsharp/core/csext/test.fsx +++ b/tests/fsharp/core/csext/test.fsx @@ -32,16 +32,16 @@ xie.All(fun x -> x > 1) xie.Average() x.Average() -[] -type S(v:int) = - interface System.Collections.Generic.IEnumerable with - member x.GetEnumerator() = (Seq.singleton v).GetEnumerator() - interface System.Collections.IEnumerable with - member x.GetEnumerator() = ((Seq.singleton v).GetEnumerator() :> System.Collections.IEnumerator) - -let s : S = S(3) - -s.Average() +// BUGBUG: https://github.com/Microsoft/visualfsharp/issues/6601 +//[] +//type S(v:int) = +// interface System.Collections.Generic.IEnumerable with +// member x.GetEnumerator() = (Seq.singleton v).GetEnumerator() +// interface System.Collections.IEnumerable with +// member x.GetEnumerator() = ((Seq.singleton v).GetEnumerator() :> System.Collections.IEnumerator) +// +//let s : S = S(3) +//s.Average() [] diff --git a/tests/fsharp/core/libtest/test.fsx b/tests/fsharp/core/libtest/test.fsx index f76c479de5e..55846a2dd45 100644 --- a/tests/fsharp/core/libtest/test.fsx +++ b/tests/fsharp/core/libtest/test.fsx @@ -4918,15 +4918,15 @@ type ToStringClass(x) = end do check "Bug1049.customClass" (string (ToStringClass("fred"))) "fred" -[] -type ToStringStruct = - struct - val x : int - new(x) = {x=x} - override this.ToString() = string this.x - end -do check "Bug1049.customStruct" (string (ToStringStruct(123))) "123" - +// BUGBUG: https://github.com/Microsoft/visualfsharp/issues/6597 +// [] +// type ToStringStruct = +// struct +// val x : int +// new(x) = {x=x} +// override this.ToString() = string this.x +// end +// do check "Bug1049.customStruct" (string (ToStringStruct(123))) "123" type ToStringEnum = | A = 1 | B = 2 @@ -5121,7 +5121,6 @@ module Check1477 = begin end end - (*--------------------------------------------------------------------------- !* BUG 1561: (-star-star-) opens a comment but does not close it and other XML Doc issues. *--------------------------------------------------------------------------- *) @@ -5320,8 +5319,6 @@ end module TestNoNullElementsInListChainFromInit = begin - - let test n x = printfn "testing %A" n; let a = List.init n x in @@ -5336,11 +5333,8 @@ module TestNoNullElementsInListChainFromInit = begin end - module TestNoNullElementsInListChainFromUnzip = begin - - let test x = printfn "testing %A" x; let a,b = List.unzip x in @@ -5432,31 +5426,35 @@ module SetToString = begin do check "cewjhnkrveo81p" ((Map.ofList [(4,40);(3,30);(2,20);(1,10)]) |> sprintf "%A") "map [(1, 10); (2, 20); (3, 30); (4, 40)]" end -(*--------------------------------------------------------------------------- -!* Bug 5816: Unable to define mutually recursive types with mutually recursive generic constraints within FSI - *--------------------------------------------------------------------------- *) -module Bug5816 = begin - type IView<'v, 'vm when 'v :> IView<'v,'vm> and 'vm :> IViewModel<'v,'vm>> = interface - abstract ViewModel : 'vm - end - and IViewModel<'v, 'vm when 'v :> IView<'v,'vm> and 'vm :> IViewModel<'v,'vm>> = interface - abstract View : 'v - end -end -(*--------------------------------------------------------------------------- -!* Bug 5825: Constraints with nested types - *--------------------------------------------------------------------------- *) -module Bug5825 = begin - type I = interface - abstract member m : unit - end - type C() = class - interface I with - member this.m = () - end - end - let f (c : #C) = () -end +// BUGBUG: https://github.com/Microsoft/visualfsharp/issues/6599 + +//(*--------------------------------------------------------------------------- +//!* Bug 5816: Unable to define mutually recursive types with mutually recursive generic constraints within FSI +// *--------------------------------------------------------------------------- *) +//module Bug5816 = begin +// type IView<'v, 'vm when 'v :> IView<'v,'vm> and 'vm :> IViewModel<'v,'vm>> = interface +// abstract ViewModel : 'vm +// end +// and IViewModel<'v, 'vm when 'v :> IView<'v,'vm> and 'vm :> IViewModel<'v,'vm>> = interface +// abstract View : 'v +// end +//end + +// BUGBUG: https://github.com/Microsoft/visualfsharp/issues/6600 +//(*--------------------------------------------------------------------------- +//!* Bug 5825: Constraints with nested types +// *--------------------------------------------------------------------------- *) +//module Bug5825 = begin +// type I = interface +// abstract member m : unit +// end +// type C() = class +// interface I with +// member this.m = () +// end +// end +// let f (c : #C) = () +//end module Bug5981 = begin // guard against type variable tokens leaking into the IL stream @@ -5501,7 +5499,6 @@ module Bug920236 = for i in a do result := i::(!result) do test "hfduweyr" (!result = [box 1]) - module TripleQuoteStrings = @@ -5597,6 +5594,7 @@ module LittleTestFor823 = let x, y = 1, 2 let v = Some ((x = y), (x = x)) + (*--------------------------------------------------------------------------- !* wrap up *--------------------------------------------------------------------------- *) diff --git a/tests/fsharp/core/members/incremental-hw-mutrec/test.fs b/tests/fsharp/core/members/incremental-hw-mutrec/test.fsx similarity index 100% rename from tests/fsharp/core/members/incremental-hw-mutrec/test.fs rename to tests/fsharp/core/members/incremental-hw-mutrec/test.fsx diff --git a/tests/fsharp/core/printf/test.fsx b/tests/fsharp/core/printf/test.fsx index 97bd8b98189..fe48744f84e 100644 --- a/tests/fsharp/core/printf/test.fsx +++ b/tests/fsharp/core/printf/test.fsx @@ -3540,6 +3540,7 @@ let func2000()= test "test2998" (lazy(sprintf "%-05x" 50000UL)) "c350 " test "test2999" (lazy(sprintf "%-01x" 50000UL)) "c350" test "test3000" (lazy(sprintf "%-0*x" 7 50000UL)) "c350 " +#if COMPILED let func3000()= test "test3001" (lazy(sprintf "%+x" 50000UL)) "+c350" test "test3002" (lazy(sprintf "%+5x" 50000UL)) "+c350" @@ -9283,16 +9284,18 @@ let func8000()= test "test8735" (lazy(sprintf "09-00%d09-01%d09-02%d09-03%d09-04%d09-05%d09-06%d09-07%d09-08%a19-10%d19-11%d19-12%d19-13%d19-14%d19-15%d19-16%d19-17%d19-18%a29-20%d29-21%d29-22%d29-23%d29-24%d29-25%d29-26%d29-27%d29-28%a39-30%d39-31%d39-32%d39-33%d39-34%d39-35%d39-36%d39-37%d39-38%a49-40%d49-41%d49-42%d49-43%d49-44%d49-45%d49-46%d49-47%d49-48%a59-50%d59-51%d59-52%d59-53%d59-54%d59-55%d59-56%d59-57%d59-58%a69-60%d69-61%d69-62%d69-63%d69-64%d69-65%d69-66%d69-67%d69-68%a79-70%d79-71%d79-72%d79-73%d79-74%d79-75%d79-76%d79-77%d79-78%a89-80%d89-81%d89-82%d89-83%d89-84%d89-85%d89-86%d89-87%d89-88%a99-90%d99-91%d99-92%d99-93%d99-94%d99-95%d99-96%d99-97%d99-98%a_TAIL" 0 1 2 3 4 5 6 7 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 16 17 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 25 26 27 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 35 36 37 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 45 46 47 (fun _ v -> (string v) + "X") 5 50 51 52 53 54 55 56 57 (fun _ v -> (string v) + "X") 6 60 61 62 63 64 65 66 67 (fun _ v -> (string v) + "X") 7 70 71 72 73 74 75 76 77 (fun _ v -> (string v) + "X") 8 80 81 82 83 84 85 86 87 (fun _ v -> (string v) + "X") 9 90 91 92 93 94 95 96 97 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "09-00009-01109-02209-03309-04409-05509-06609-07709-081X19-101019-111119-121219-131319-141419-151519-161619-171719-182X29-202029-212129-222229-232329-242429-252529-262629-272729-283X39-303039-313139-323239-333339-343439-353539-363639-373739-384X49-404049-414149-424249-434349-444449-454549-464649-474749-485X59-505059-515159-525259-535359-545459-555559-565659-575759-586X69-606069-616169-626269-636369-646469-656569-666669-676769-687X79-707079-717179-727279-737379-747479-757579-767679-777779-788X89-808089-818189-828289-838389-848489-858589-868689-878789-889X99-909099-919199-929299-939399-949499-959599-969699-979799-98ReadX_TAIL" test "test8736" (lazy(sprintf "09-00%d09-01%d09-02%d09-03%d09-04%d09-05%d09-06%d09-07%d09-08%d09-09%a19-10%d19-11%d19-12%d19-13%d19-14%d19-15%d19-16%d19-17%d19-18%d19-19%a29-20%d29-21%d29-22%d29-23%d29-24%d29-25%d29-26%d29-27%d29-28%d29-29%a39-30%d39-31%d39-32%d39-33%d39-34%d39-35%d39-36%d39-37%d39-38%d39-39%a49-40%d49-41%d49-42%d49-43%d49-44%d49-45%d49-46%d49-47%d49-48%d49-49%a59-50%d59-51%d59-52%d59-53%d59-54%d59-55%d59-56%d59-57%d59-58%d59-59%a69-60%d69-61%d69-62%d69-63%d69-64%d69-65%d69-66%d69-67%d69-68%d69-69%a79-70%d79-71%d79-72%d79-73%d79-74%d79-75%d79-76%d79-77%d79-78%d79-79%a89-80%d89-81%d89-82%d89-83%d89-84%d89-85%d89-86%d89-87%d89-88%d89-89%a99-90%d99-91%d99-92%d99-93%d99-94%d99-95%d99-96%d99-97%d99-98%d99-99" 0 1 2 3 4 5 6 7 8 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 16 17 18 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 25 26 27 28 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 35 36 37 38 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 45 46 47 48 (fun _ v -> (string v) + "X") 5 50 51 52 53 54 55 56 57 58 (fun _ v -> (string v) + "X") 6 60 61 62 63 64 65 66 67 68 (fun _ v -> (string v) + "X") 7 70 71 72 73 74 75 76 77 78 (fun _ v -> (string v) + "X") 8 80 81 82 83 84 85 86 87 88 (fun _ v -> (string v) + "X") 9 90 91 92 93 94 95 96 97 98 )) "09-00009-01109-02209-03309-04409-05509-06609-07709-08809-091X19-101019-111119-121219-131319-141419-151519-161619-171719-181819-192X29-202029-212129-222229-232329-242429-252529-262629-272729-282829-293X39-303039-313139-323239-333339-343439-353539-363639-373739-383839-394X49-404049-414149-424249-434349-444449-454549-464649-474749-484849-495X59-505059-515159-525259-535359-545459-555559-565659-575759-585859-596X69-606069-616169-626269-636369-646469-656569-666669-676769-686869-697X79-707079-717179-727279-737379-747479-757579-767679-777779-787879-798X89-808089-818189-828289-838389-848489-858589-868689-878789-888889-899X99-909099-919199-929299-939399-949499-959599-969699-979799-989899-99" test "test8737" (lazy(sprintf "09-00%d09-01%d09-02%d09-03%d09-04%d09-05%d09-06%d09-07%d09-08%d09-09%a19-10%d19-11%d19-12%d19-13%d19-14%d19-15%d19-16%d19-17%d19-18%d19-19%a29-20%d29-21%d29-22%d29-23%d29-24%d29-25%d29-26%d29-27%d29-28%d29-29%a39-30%d39-31%d39-32%d39-33%d39-34%d39-35%d39-36%d39-37%d39-38%d39-39%a49-40%d49-41%d49-42%d49-43%d49-44%d49-45%d49-46%d49-47%d49-48%d49-49%a59-50%d59-51%d59-52%d59-53%d59-54%d59-55%d59-56%d59-57%d59-58%d59-59%a69-60%d69-61%d69-62%d69-63%d69-64%d69-65%d69-66%d69-67%d69-68%d69-69%a79-70%d79-71%d79-72%d79-73%d79-74%d79-75%d79-76%d79-77%d79-78%d79-79%a89-80%d89-81%d89-82%d89-83%d89-84%d89-85%d89-86%d89-87%d89-88%d89-89%a99-90%d99-91%d99-92%d99-93%d99-94%d99-95%d99-96%d99-97%d99-98%d99-99%a_TAIL" 0 1 2 3 4 5 6 7 8 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 16 17 18 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 25 26 27 28 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 35 36 37 38 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 45 46 47 48 (fun _ v -> (string v) + "X") 5 50 51 52 53 54 55 56 57 58 (fun _ v -> (string v) + "X") 6 60 61 62 63 64 65 66 67 68 (fun _ v -> (string v) + "X") 7 70 71 72 73 74 75 76 77 78 (fun _ v -> (string v) + "X") 8 80 81 82 83 84 85 86 87 88 (fun _ v -> (string v) + "X") 9 90 91 92 93 94 95 96 97 98 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "09-00009-01109-02209-03309-04409-05509-06609-07709-08809-091X19-101019-111119-121219-131319-141419-151519-161619-171719-181819-192X29-202029-212129-222229-232329-242429-252529-262629-272729-282829-293X39-303039-313139-323239-333339-343439-353539-363639-373739-383839-394X49-404049-414149-424249-434349-444449-454549-464649-474749-484849-495X59-505059-515159-525259-535359-545459-555559-565659-575759-585859-596X69-606069-616169-626269-636369-646469-656569-666669-676769-686869-697X79-707079-717179-727279-737379-747479-757579-767679-777779-787879-798X89-808089-818189-828289-838389-848489-858589-868689-878789-888889-899X99-909099-919199-929299-939399-949499-959599-969699-979799-989899-99ReadX_TAIL" +#endif func0() func1000() func2000() +#if COMPILED func3000() func4000() func5000() func6000() func7000() func8000() - +#endif #if TESTS_AS_APP let RUN() = !failures diff --git a/tests/fsharp/core/recordResolution/build.bat b/tests/fsharp/core/recordResolution/build.bat deleted file mode 100644 index a6ff3718fe7..00000000000 --- a/tests/fsharp/core/recordResolution/build.bat +++ /dev/null @@ -1,6 +0,0 @@ -@if "%_echo%"=="" echo off - -call %~d0%~p0..\..\single-test-build.bat - -exit /b %ERRORLEVEL% - diff --git a/tests/fsharp/core/recordResolution/test.fs b/tests/fsharp/core/recordResolution/test.fsx similarity index 100% rename from tests/fsharp/core/recordResolution/test.fs rename to tests/fsharp/core/recordResolution/test.fsx diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 51c4638dfb2..85339e4e6e9 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -71,11 +71,11 @@ module CoreTests = [] let ``innerpoly-FSC_BASIC`` () = singleTestBuildAndRun "core/innerpoly" FSC_BASIC - [] - let namespaceAttributes () = singleTestBuildAndRun "core/namespaces" FSC_BASIC + [] + let ``namespaceAttributes-FSC_BASIC`` () = singleTestBuildAndRun "core/namespaces" FSC_BASIC [] - let unicode2 () = singleTestBuildAndRun "core/unicode" FSC_BASIC // TODO: fails on coreclr + let ``unicode2-FSC_BASIC`` () = singleTestBuildAndRun "core/unicode" FSC_BASIC // TODO: fails on coreclr [] let ``unicode2-FSI_BASIC`` () = singleTestBuildAndRun "core/unicode" FSI_BASIC @@ -102,70 +102,132 @@ module CoreTests = let ``libtest-FSC_BASIC`` () = singleTestBuildAndRun "core/libtest" FSC_BASIC [] - let lift () = singleTestBuildAndRun "core/lift" FSC_BASIC + let ``libtest-FSI_BASIC`` () = singleTestBuildAndRun "core/libtest" FSI_BASIC [] - let map () = singleTestBuildAndRun "core/map" FSC_BASIC + let ``lift-FSC_BASIC`` () = singleTestBuildAndRun "core/lift" FSC_BASIC [] - let ``measures-FSI_BASIC`` () = singleTestBuildAndRun "core/measures" FSI_BASIC + let ``lift-FSI_BASIC`` () = singleTestBuildAndRun "core/lift" FSI_BASIC + + [] + let ``map-FSC_BASIC`` () = singleTestBuildAndRun "core/map" FSC_BASIC + + [] + let ``map-FSI_BASIC`` () = singleTestBuildAndRun "core/map" FSI_BASIC [] let ``measures-FSC_BASIC`` () = singleTestBuildAndRun "core/measures" FSC_BASIC [] - let nested () = singleTestBuildAndRun "core/nested" FSC_BASIC + let ``measures-FSI_BASIC`` () = singleTestBuildAndRun "core/measures" FSI_BASIC + + [] + let ``nested-FSC_BASIC`` () = singleTestBuildAndRun "core/nested" FSC_BASIC + + [] + let ``nested-FSI_BASIC`` () = singleTestBuildAndRun "core/nested" FSI_BASIC + + [] + let ``members-ops-FSC_BASIC`` () = singleTestBuildAndRun "core/members/ops" FSC_BASIC + + [] + let ``members-ops-FSI_BASIC`` () = singleTestBuildAndRun "core/members/ops" FSI_BASIC + + [] + let ``members-ops-mutrec-FSC_BASIC`` () = singleTestBuildAndRun "core/members/ops-mutrec" FSC_BASIC + + [] + let ``members-ops-mutrec-FSI_BASIC`` () = singleTestBuildAndRun "core/members/ops-mutrec" FSI_BASIC + + [] + let ``seq-FSC_BASIC`` () = singleTestBuildAndRun "core/seq" FSC_BASIC + + [] + let ``seq-FSI_BASIC`` () = singleTestBuildAndRun "core/seq" FSI_BASIC + + [] + let ``math-numbers-FSC_BASIC`` () = singleTestBuildAndRun "core/math/numbers" FSC_BASIC + + [] + let ``math-numbers-FSI_BASIC`` () = singleTestBuildAndRun "core/math/numbers" FSI_BASIC [] - let ``members-ops`` () = singleTestBuildAndRun "core/members/ops" FSC_BASIC + let ``members-ctree-FSC_BASIC`` () = singleTestBuildAndRun "core/members/ctree" FSC_BASIC [] - let ``members-ops-mutrec`` () = singleTestBuildAndRun "core/members/ops-mutrec" FSC_BASIC + let ``members-ctree-FSI_BASIC`` () = singleTestBuildAndRun "core/members/ctree" FSI_BASIC [] - let seq () = singleTestBuildAndRun "core/seq" FSC_BASIC + let ``members-factors-FSC_BASIC`` () = singleTestBuildAndRun "core/members/factors" FSC_BASIC [] - let ``math-numbers`` () = singleTestBuildAndRun "core/math/numbers" FSC_BASIC + let ``members-factors-FSI_BASIC`` () = singleTestBuildAndRun "core/members/factors" FSI_BASIC + [] + let ``members-factors-mutrec-FSC_BASIC`` () = singleTestBuildAndRun "core/members/factors-mutrec" FSC_BASIC [] - let ``members-ctree`` () = singleTestBuildAndRun "core/members/ctree" FSC_BASIC + let ``members-factors-mutrec-FSI_BASIC`` () = singleTestBuildAndRun "core/members/factors-mutrec" FSI_BASIC [] - let ``members-factors`` () = singleTestBuildAndRun "core/members/factors" FSC_BASIC + let ``graph-FSC_BASIC`` () = singleTestBuildAndRun "perf/graph" FSC_BASIC [] - let ``members-factors-mutrec`` () = singleTestBuildAndRun "core/members/factors-mutrec" FSC_BASIC + let ``graph-FSI_BASIC`` () = singleTestBuildAndRun "perf/graph" FSI_BASIC [] - let graph () = singleTestBuildAndRun "perf/graph" FSC_BASIC + let ``nbody-FSC_BASIC`` () = singleTestBuildAndRun "perf/nbody" FSC_BASIC [] - let nbody () = singleTestBuildAndRun "perf/nbody" FSC_BASIC + let ``nbody-FSI_BASIC`` () = singleTestBuildAndRun "perf/nbody" FSI_BASIC [] let ``letrec (mutrec variations part two) FSC_BASIC`` () = singleTestBuildAndRun "core/letrec-mutrec2" FSC_BASIC [] - let printf () = singleTestBuildAndRun "core/printf" FSC_BASIC + let ``letrec (mutrec variations part two) FSI_BASIC`` () = singleTestBuildAndRun "core/letrec-mutrec2" FSI_BASIC [] - let tlr () = singleTestBuildAndRun "core/tlr" FSC_BASIC + let ``printf-FSC_BASIC`` () = singleTestBuildAndRun "core/printf" FSC_BASIC [] - let subtype () = singleTestBuildAndRun "core/subtype" FSC_BASIC + let ``tlr-FSC_BASIC`` () = singleTestBuildAndRun "core/tlr" FSC_BASIC [] - let syntax () = singleTestBuildAndRun "core/syntax" FSC_BASIC + let ``tlr-FSI_BASIC`` () = singleTestBuildAndRun "core/tlr" FSI_BASIC [] - let ``test int32`` () = singleTestBuildAndRun "core/int32" FSC_BASIC + let ``subtype-FSC_BASIC`` () = singleTestBuildAndRun "core/subtype" FSC_BASIC + + [] + let ``subtype-FSI_BASIC`` () = singleTestBuildAndRun "core/subtype" FSI_BASIC + + [] + let ``syntax-FSC_BASIC`` () = singleTestBuildAndRun "core/syntax" FSC_BASIC + + [] + let ``syntax-FSI_BASIC`` () = singleTestBuildAndRun "core/syntax" FSI_BASIC + + [] + let ``test int32-FSC_BASIC`` () = singleTestBuildAndRun "core/int32" FSC_BASIC + + [] + let ``test int32-FSI_BASIC`` () = singleTestBuildAndRun "core/int32" FSI_BASIC -#if !FSHARP_SUITE_DRIVES_CORECLR_TESTS [] let ``quotes-FSC-BASIC`` () = singleTestBuildAndRun "core/quotes" FSC_BASIC // TODO: fails on coreclr + [] + let ``quotes-FSI-BASIC`` () = singleTestBuildAndRun "core/quotes" FSI_BASIC + + [] + let ``recordResolution-FSC_BASIC`` () = singleTestBuildAndRun "core/recordResolution" FSC_BASIC + + [] + let ``recordResolution-FSI_BASIC`` () = singleTestBuildAndRun "core/recordResolution" FSI_BASIC + +#if !FSHARP_SUITE_DRIVES_CORECLR_TESTS [] let ``attributes-FSC_BASIC`` () = singleTestBuildAndRun "core/attributes" FSC_BASIC @@ -364,50 +426,56 @@ module CoreTests = #endif [] - let control () = singleTestBuildAndRun "core/control" FSC_BASIC + let ``control-FSC_BASIC`` () = singleTestBuildAndRun "core/control" FSC_BASIC [] - let ``control --tailcalls`` () = + let ``control-FSI_BASIC`` () = singleTestBuildAndRun "core/control" FSI_BASIC + + [] + let ``control --tailcalls`` () = let cfg = testConfig "core/control" singleTestBuildAndRunAux {cfg with fsi_flags = " --tailcalls" } FSC_BASIC - [] - let controlChamenos () = + let ``controlChamenos-FSC_BASIC`` () = let cfg = testConfig "core/controlChamenos" - singleTestBuildAndRunAux {cfg with fsi_flags = " --tailcalls" } FSC_BASIC + [] + let ``controlChamenos-FSI_BASIC`` () = + let cfg = testConfig "core/controlChamenos" + singleTestBuildAndRunAux {cfg with fsi_flags = " --tailcalls" } FSI_BASIC [] - let controlMailbox () = singleTestBuildAndRun "core/controlMailbox" FSC_BASIC + let ``controlMailbox-FSC_BASIC`` () = singleTestBuildAndRun "core/controlMailbox" FSC_BASIC [] - let ``controlMailbox --tailcalls`` () = + let ``controlMailbox-FSI_BASIC`` () = singleTestBuildAndRun "core/controlMailbox" FSI_BASIC + + [] + let ``controlMailbox --tailcalls`` () = let cfg = testConfig "core/controlMailbox" - singleTestBuildAndRunAux {cfg with fsi_flags = " --tailcalls" } FSC_BASIC - -#if !FSHARP_SUITE_DRIVES_CORECLR_TESTS - // Requires winforms will not run on coreclr [] - let controlWpf () = singleTestBuildAndRun "core/controlwpf" FSC_BASIC -#endif + let ``csext-FSC_BASIC`` () = singleTestBuildAndRun "core/csext" FSC_BASIC [] - let csext () = singleTestBuildAndRun "core/csext" FSC_BASIC - + let ``csext-FSI_BASIC`` () = singleTestBuildAndRun "core/csext" FSI_BASIC [] - let fscenum () = singleTestBuildAndRun "core/enum" FSC_BASIC + let ``enum-FSC_BASIC`` () = singleTestBuildAndRun "core/enum" FSC_BASIC -// [] -// let fsienum () = singleTestBuildAndRun "core/enum" FSI_BASIC + [] + let ``enum-FSI_BASIC`` () = singleTestBuildAndRun "core/enum" FSI_BASIC #if !FSHARP_SUITE_DRIVES_CORECLR_TESTS - // These tests are enabled for .NET Framework and .NET Core + // Requires winforms will not run on coreclr + [] + let controlWpf () = singleTestBuildAndRun "core/controlwpf" FSC_BASIC + + // These tests are enabled for .NET Framework [] let ``anon-FSC_BASIC``() = let cfg = testConfig "core/anon" @@ -628,7 +696,6 @@ module CoreTests = end fsc cfg "" ["load1.fsx"] - fsc cfg "" ["load2.fsx"] @@ -708,8 +775,6 @@ module CoreTests = testOkFile.CheckExists() end - - // Debug with // ..\..\..\..\debug\net40\bin\fsi.exe --nologo < test.fsx >a.out 2>a.err @@ -863,9 +928,6 @@ module CoreTests = #endif #if !FSHARP_SUITE_DRIVES_CORECLR_TESTS - [] - let ``quotes-FSI-BASIC`` () = singleTestBuildAndRun "core/quotes" FSI_BASIC - [] let quotes () = let cfg = testConfig "core/quotes" @@ -1042,15 +1104,6 @@ module CoreTests = [] let ``libtest-AS_DLL`` () = singleTestBuildAndRun "core/libtest" AS_DLL - [] - let ``libtest-FSI_BASIC`` () = singleTestBuildAndRun "core/libtest" FSI_BASIC - - [] - let ``letrec (mutrec variations part two) FSI_BASIC`` () = singleTestBuildAndRun "core/letrec-mutrec2" FSI_BASIC - - [] - let recordResolution () = singleTestBuildAndRun "core/recordResolution" FSC_BASIC - [] let ``no-warn-2003-tests`` () = // see https://github.com/Microsoft/visualfsharp/issues/3139 @@ -1242,58 +1295,60 @@ module CoreTests = #endif [] - let longnames () = singleTestBuildAndRun "core/longnames" FSC_BASIC + let ``longnames-FSC_BASIC`` () = singleTestBuildAndRun "core/longnames" FSC_BASIC [] - let ``math-numbersVS2008`` () = singleTestBuildAndRun "core/math/numbersVS2008" FSC_BASIC + let ``longnames-FSI_BASIC`` () = singleTestBuildAndRun "core/longnames" FSI_BASIC -#if !FSHARP_SUITE_DRIVES_CORECLR_TESTS [] - let ``measures-AS_DLL`` () = singleTestBuildAndRun "core/measures" AS_DLL + let ``math-numbersVS2008-FSC_BASIC`` () = singleTestBuildAndRun "core/math/numbersVS2008" FSC_BASIC - // Requires winforms will not run on coreclr [] - let ``members-basics-FSI_BASIC`` () = singleTestBuildAndRun "core/members/basics" FSI_BASIC + let ``math-numbersVS2008-FSI_BASIC`` () = singleTestBuildAndRun "core/math/numbersVS2008" FSI_BASIC - // Requires winforms will not run on coreclr [] - let ``members-basics-FSC_BASIC`` () = singleTestBuildAndRun "core/members/basics" FSC_BASIC + let ``patterns-FSC_BASIC`` () = singleTestBuildAndRun "core/patterns" FSC_BASIC + +//BUGBUG: https://github.com/Microsoft/visualfsharp/issues/6601 +// [] +// let ``patterns-FSI_BASIC`` () = singleTestBuildAndRun "core/patterns" FSI_BASIC + +#if !FSHARP_SUITE_DRIVES_CORECLR_TESTS + [] + let ``measures-AS_DLL`` () = singleTestBuildAndRun "core/measures" AS_DLL - // Requires winforms will not run on coreclr [] let ``members-basics-AS_DLL`` () = singleTestBuildAndRun "core/members/basics" AS_DLL - // Requires winforms will not run on coreclr [] let ``members-basics-hw`` () = singleTestBuildAndRun "core/members/basics-hw" FSC_BASIC - // Requires winforms will not run on coreclr [] let ``members-basics-hw-mutrec`` () = singleTestBuildAndRun "core/members/basics-hw-mutrec" FSC_BASIC [] - let ``members-incremental`` () = singleTestBuildAndRun "core/members/incremental" FSC_BASIC + let ``members-incremental-FSC_BASIC`` () = singleTestBuildAndRun "core/members/incremental" FSC_BASIC [] - let ``members-incremental-hw`` () = singleTestBuildAndRun "core/members/incremental-hw" FSC_BASIC + let ``members-incremental-FSI_BASIC`` () = singleTestBuildAndRun "core/members/incremental" FSI_BASIC [] - let ``members-incremental-hw-mutrec`` () = singleTestBuildAndRun "core/members/incremental-hw-mutrec" FSC_BASIC + let ``members-incremental-hw-FSC_BASIC`` () = singleTestBuildAndRun "core/members/incremental-hw" FSC_BASIC -#endif + [] + let ``members-incremental-hw-FSI_BASIC`` () = singleTestBuildAndRun "core/members/incremental-hw" FSI_BASIC [] - let patterns () = singleTestBuildAndRun "core/patterns" FSC_BASIC + let ``members-incremental-hw-mutrec-FSC_BASIC`` () = singleTestBuildAndRun "core/members/incremental-hw-mutrec" FSC_BASIC -#if !FSHARP_SUITE_DRIVES_CORECLR_TESTS [] let pinvoke () = let cfg = testConfig "core/pinvoke" fsc cfg "%s -o:test.exe -g" cfg.fsc_flags ["test.fsx"] - + peverifyWithArgs cfg "/nologo /MD" "test.exe" - + [] let fsi_load () = let cfg = testConfig "core/fsi-load" @@ -1500,10 +1555,12 @@ module CoreTests = testOkFile.CheckExists() #endif - + [] - let reflect () = singleTestBuildAndRun "core/reflect" FSC_BASIC + let ``reflect-FSC_BASIC`` () = singleTestBuildAndRun "core/reflect" FSC_BASIC + [] + let ``reflect-FSI_BASIC`` () = singleTestBuildAndRun "core/reflect" FSI_BASIC #if !FSHARP_SUITE_DRIVES_CORECLR_TESTS [] @@ -1754,10 +1811,10 @@ module ToolsTests = peverify cfg "test_two_fsharp_modules_module_2_as_dll.dll" #endif -#if !FSHARP_SUITE_DRIVES_CORECLR_TESTS [] - let eval () = singleTestBuildAndRun "tools/eval" FSC_BASIC -#endif + let ``eval-FSC_BASIC`` () = singleTestBuildAndRun "tools/eval" FSC_BASIC + [] + let ``eval-FSI_BASIC`` () = singleTestBuildAndRun "tools/eval" FSI_BASIC module RegressionTests = @@ -2018,7 +2075,6 @@ module TypecheckTests = SingleTest.singleTestBuildAndRunWithCopyDlls cfg "full-rank-arrays.dll" FSC_BASIC #if !FX_NO_CONVERTER - // Converter is not coming back until dotnet standard 2.0 [] let misc () = singleTestBuildAndRun "typecheck/misc" FSC_BASIC #endif diff --git a/tests/fsharp/tools/eval/test.fsx b/tests/fsharp/tools/eval/test.fsx index b2cfedc68fa..e3545645b2e 100644 --- a/tests/fsharp/tools/eval/test.fsx +++ b/tests/fsharp/tools/eval/test.fsx @@ -1,10 +1,5 @@ #light -#if !NETSTANDARD -#r @"System.Core.dll" -#r @"System.Data.Linq.dll" -#endif - #nowarn "57" open Microsoft.FSharp.Quotations @@ -665,22 +660,29 @@ module QuotationEvaluation = let env = Map.add v (vP |> asExpr) env let tyargs = [| v.Type; body.Type |] let bodyP = ConvExpr env body - let convType = typedefof>.MakeGenericType tyargs + let lambdaTy, tyargs = + if bodyP.Type = typeof then + let tyargs = [| vP.Type |] + typedefof>, tyargs + else + let tyargs = [| vP.Type; bodyP.Type |] + typedefof>, tyargs + let convType = lambdaTy.MakeGenericType tyargs let convDelegate = Expression.Lambda(convType, bodyP, [| vP |]) |> asExpr - Expression.Call(typeof,"ToFSharpFunc",tyargs,[| convDelegate |]) |> asExpr - + Expression.Call(typeof, "ToFSharpFunc", tyargs, [| convDelegate |]) |> asExpr + | Patterns.WhileLoop(gd,b) -> let gdP = ConvExpr env <@@ (fun () -> (%%gd:bool)) @@> let bP = ConvExpr env <@@ (fun () -> (%%b:unit)) @@> let minfo = WhileMethod.GetGenericMethodDefinition().MakeGenericMethod [| typeof |] Expression.Call(minfo,[| gdP; bP |]) |> asExpr - + | Patterns.TryFinally(e,h) -> let eP = ConvExpr env (Expr.Lambda(new Var("unitVar",typeof), e)) let hP = ConvExpr env <@@ (fun () -> (%%h:unit)) @@> let minfo = TryFinallyMethod.GetGenericMethodDefinition().MakeGenericMethod [| e.Type |] Expression.Call(minfo,[| eP; hP |]) |> asExpr - + | Patterns.TryWith(e,vf,filter,vh,handler) -> let eP = ConvExpr env (Expr.Lambda(new Var("unitVar",typeof), e)) let filterP = ConvExpr env (Expr.Lambda(vf,filter)) diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/AnonRecd.fs b/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/AnonRecd.fs new file mode 100644 index 00000000000..74ad9e7c857 --- /dev/null +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/AnonRecd.fs @@ -0,0 +1,10 @@ + + +let main argv = + let mutable x = 1 + + let a = {| A = 1; B = 1 |} + + x <- x + 1 + + 0 diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/AnonRecd.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/AnonRecd.il.bsl new file mode 100644 index 00000000000..af9a419018c --- /dev/null +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/AnonRecd.il.bsl @@ -0,0 +1,642 @@ + +// Microsoft (R) .NET Framework IL Disassembler. Version 4.7.3081.0 +// Copyright (c) Microsoft Corporation. All rights reserved. + + + +// Metadata version: v4.0.30319 +.assembly extern mscorlib +{ + .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. + .ver 4:0:0:0 +} +.assembly extern FSharp.Core +{ + .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: + .ver 4:6:0:0 +} +.assembly AnonRecd +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, + int32, + int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) + + // --- The following custom attribute is added automatically, do not uncomment ------- + // .custom instance void [mscorlib]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 01 01 00 00 00 00 ) + + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.mresource public FSharpSignatureData.AnonRecd +{ + // Offset: 0x00000000 Length: 0x000001CE +} +.mresource public FSharpOptimizationData.AnonRecd +{ + // Offset: 0x000001D8 Length: 0x0000006B +} +.module AnonRecd.exe +// MVID: {5CBDEF61-C42F-5208-A745-038361EFBD5C} +.imagebase 0x00400000 +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 // WINDOWS_CUI +.corflags 0x00000001 // ILONLY +// Image base: 0x00D20000 + + +// =============== CLASS MEMBERS DECLARATION =================== + +.class public abstract auto ansi sealed AnonRecd + extends [mscorlib]System.Object +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .method public static int32 main(!!a argv) cil managed + { + // Code size 16 (0x10) + .maxstack 4 + .locals init ([0] int32 x, + [1] class '<>f__AnonymousType1912756633`2' a) + .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' + .line 4,4 : 5,22 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\source\\CodeGen\\EmittedIL\\Misc\\AnonRecd.fs' + IL_0000: ldc.i4.1 + IL_0001: stloc.0 + .line 6,6 : 5,31 '' + IL_0002: ldc.i4.1 + IL_0003: ldc.i4.1 + IL_0004: newobj instance void class '<>f__AnonymousType1912756633`2'::.ctor(!0, + !1) + IL_0009: stloc.1 + .line 8,8 : 5,15 '' + IL_000a: ldloc.0 + IL_000b: ldc.i4.1 + IL_000c: add + IL_000d: stloc.0 + .line 10,10 : 5,6 '' + IL_000e: ldc.i4.0 + IL_000f: ret + } // end of method AnonRecd::main + +} // end of class AnonRecd + +.class private abstract auto ansi sealed ''.$AnonRecd + extends [mscorlib]System.Object +{ + .method public static void main@() cil managed + { + .entrypoint + // Code size 1 (0x1) + .maxstack 8 + IL_0000: ret + } // end of method $AnonRecd::main@ + +} // end of class ''.$AnonRecd + +.class public auto ansi serializable sealed beforefieldinit '<>f__AnonymousType1912756633`2'<'j__TPar','j__TPar'> + extends [mscorlib]System.Object + implements [mscorlib]System.Collections.IStructuralComparable, + [mscorlib]System.IComparable, + class [mscorlib]System.IComparable`1f__AnonymousType1912756633`2'j__TPar',!'j__TPar'>>, + [mscorlib]System.Collections.IStructuralEquatable, + class [mscorlib]System.IEquatable`1f__AnonymousType1912756633`2'j__TPar',!'j__TPar'>> +{ + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 02 00 00 00 00 00 ) + .field private !'j__TPar' A@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field private !'j__TPar' B@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public specialname rtspecialname + instance void .ctor(!'j__TPar' A, + !'j__TPar' B) cil managed + { + // Code size 21 (0x15) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void [mscorlib]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld !0 class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'>::A@ + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld !1 class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'>::B@ + IL_0014: ret + } // end of method '<>f__AnonymousType1912756633`2'::.ctor + + .method public hidebysig specialname instance !'j__TPar' + get_A() cil managed + { + // Code size 7 (0x7) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld !0 class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'>::A@ + IL_0006: ret + } // end of method '<>f__AnonymousType1912756633`2'::get_A + + .method public hidebysig specialname instance !'j__TPar' + get_B() cil managed + { + // Code size 7 (0x7) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld !1 class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'>::B@ + IL_0006: ret + } // end of method '<>f__AnonymousType1912756633`2'::get_B + + .method public strict virtual instance string + ToString() cil managed + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 22 (0x16) + .maxstack 8 + IL_0000: ldstr "%+A" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5f__AnonymousType1912756633`2'j__TPar',!'j__TPar'>,string>,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'>>::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToStringf__AnonymousType1912756633`2'j__TPar',!'j__TPar'>,string>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: ldarg.0 + IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2f__AnonymousType1912756633`2'j__TPar',!'j__TPar'>,string>::Invoke(!0) + IL_0015: ret + } // end of method '<>f__AnonymousType1912756633`2'::ToString + + .method public hidebysig virtual final + instance int32 CompareTo(class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'> obj) cil managed + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 104 (0x68) + .maxstack 5 + .locals init ([0] int32 V_0) + .line 100001,100001 : 0,0 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\source\\CodeGen\\EmittedIL\\Misc\\unknown' + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: cgt.un + IL_0004: brfalse.s IL_0008 + + IL_0006: br.s IL_000a + + IL_0008: br.s IL_005a + + .line 100001,100001 : 0,0 '' + IL_000a: ldarg.1 + IL_000b: ldnull + IL_000c: cgt.un + IL_000e: brfalse.s IL_0012 + + IL_0010: br.s IL_0014 + + IL_0012: br.s IL_0058 + + .line 100001,100001 : 0,0 '' + IL_0014: call class [mscorlib]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_0019: ldarg.0 + IL_001a: ldfld !0 class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'>::A@ + IL_001f: ldarg.1 + IL_0020: ldfld !0 class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'>::A@ + IL_0025: call int32 [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::GenericComparisonWithComparerj__TPar'>(class [mscorlib]System.Collections.IComparer, + !!0, + !!0) + IL_002a: stloc.0 + IL_002b: ldloc.0 + IL_002c: ldc.i4.0 + IL_002d: bge.s IL_0031 + + IL_002f: br.s IL_0033 + + IL_0031: br.s IL_0035 + + .line 100001,100001 : 0,0 '' + IL_0033: ldloc.0 + IL_0034: ret + + .line 100001,100001 : 0,0 '' + IL_0035: ldloc.0 + IL_0036: ldc.i4.0 + IL_0037: ble.s IL_003b + + IL_0039: br.s IL_003d + + IL_003b: br.s IL_003f + + .line 100001,100001 : 0,0 '' + IL_003d: ldloc.0 + IL_003e: ret + + .line 100001,100001 : 0,0 '' + IL_003f: call class [mscorlib]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_0044: ldarg.0 + IL_0045: ldfld !1 class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'>::B@ + IL_004a: ldarg.1 + IL_004b: ldfld !1 class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'>::B@ + IL_0050: tail. + IL_0052: call int32 [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::GenericComparisonWithComparerj__TPar'>(class [mscorlib]System.Collections.IComparer, + !!0, + !!0) + IL_0057: ret + + .line 100001,100001 : 0,0 '' + IL_0058: ldc.i4.1 + IL_0059: ret + + .line 100001,100001 : 0,0 '' + IL_005a: ldarg.1 + IL_005b: ldnull + IL_005c: cgt.un + IL_005e: brfalse.s IL_0062 + + IL_0060: br.s IL_0064 + + IL_0062: br.s IL_0066 + + .line 100001,100001 : 0,0 '' + IL_0064: ldc.i4.m1 + IL_0065: ret + + .line 100001,100001 : 0,0 '' + IL_0066: ldc.i4.0 + IL_0067: ret + } // end of method '<>f__AnonymousType1912756633`2'::CompareTo + + .method public hidebysig virtual final + instance int32 CompareTo(object obj) cil managed + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 15 (0xf) + .maxstack 8 + .line 1,1 : 1,1 '' + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: unbox.any class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'> + IL_0007: tail. + IL_0009: callvirt instance int32 class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'>::CompareTo(class '<>f__AnonymousType1912756633`2') + IL_000e: ret + } // end of method '<>f__AnonymousType1912756633`2'::CompareTo + + .method public hidebysig virtual final + instance int32 CompareTo(object obj, + class [mscorlib]System.Collections.IComparer comp) cil managed + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 115 (0x73) + .maxstack 5 + .locals init ([0] class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'> V_0, + [1] class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'> V_1, + [2] int32 V_2) + .line 1,1 : 1,1 '' + IL_0000: ldarg.1 + IL_0001: unbox.any class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'> + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: stloc.1 + IL_0009: ldarg.0 + IL_000a: ldnull + IL_000b: cgt.un + IL_000d: brfalse.s IL_0011 + + IL_000f: br.s IL_0013 + + IL_0011: br.s IL_0060 + + .line 100001,100001 : 0,0 '' + IL_0013: ldarg.1 + IL_0014: unbox.any class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'> + IL_0019: ldnull + IL_001a: cgt.un + IL_001c: brfalse.s IL_0020 + + IL_001e: br.s IL_0022 + + IL_0020: br.s IL_005e + + .line 100001,100001 : 0,0 '' + IL_0022: ldarg.2 + IL_0023: ldarg.0 + IL_0024: ldfld !0 class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'>::A@ + IL_0029: ldloc.1 + IL_002a: ldfld !0 class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'>::A@ + IL_002f: call int32 [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::GenericComparisonWithComparerj__TPar'>(class [mscorlib]System.Collections.IComparer, + !!0, + !!0) + IL_0034: stloc.2 + IL_0035: ldloc.2 + IL_0036: ldc.i4.0 + IL_0037: bge.s IL_003b + + IL_0039: br.s IL_003d + + IL_003b: br.s IL_003f + + .line 100001,100001 : 0,0 '' + IL_003d: ldloc.2 + IL_003e: ret + + .line 100001,100001 : 0,0 '' + IL_003f: ldloc.2 + IL_0040: ldc.i4.0 + IL_0041: ble.s IL_0045 + + IL_0043: br.s IL_0047 + + IL_0045: br.s IL_0049 + + .line 100001,100001 : 0,0 '' + IL_0047: ldloc.2 + IL_0048: ret + + .line 100001,100001 : 0,0 '' + IL_0049: ldarg.2 + IL_004a: ldarg.0 + IL_004b: ldfld !1 class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'>::B@ + IL_0050: ldloc.1 + IL_0051: ldfld !1 class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'>::B@ + IL_0056: tail. + IL_0058: call int32 [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::GenericComparisonWithComparerj__TPar'>(class [mscorlib]System.Collections.IComparer, + !!0, + !!0) + IL_005d: ret + + .line 100001,100001 : 0,0 '' + IL_005e: ldc.i4.1 + IL_005f: ret + + .line 100001,100001 : 0,0 '' + IL_0060: ldarg.1 + IL_0061: unbox.any class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'> + IL_0066: ldnull + IL_0067: cgt.un + IL_0069: brfalse.s IL_006d + + IL_006b: br.s IL_006f + + IL_006d: br.s IL_0071 + + .line 100001,100001 : 0,0 '' + IL_006f: ldc.i4.m1 + IL_0070: ret + + .line 100001,100001 : 0,0 '' + IL_0071: ldc.i4.0 + IL_0072: ret + } // end of method '<>f__AnonymousType1912756633`2'::CompareTo + + .method public hidebysig virtual final + instance int32 GetHashCode(class [mscorlib]System.Collections.IEqualityComparer comp) cil managed + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 70 (0x46) + .maxstack 7 + .locals init ([0] int32 V_0) + .line 100001,100001 : 0,0 '' + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: cgt.un + IL_0004: brfalse.s IL_0008 + + IL_0006: br.s IL_000a + + IL_0008: br.s IL_0044 + + .line 100001,100001 : 0,0 '' + IL_000a: ldc.i4.0 + IL_000b: stloc.0 + IL_000c: ldc.i4 0x9e3779b9 + IL_0011: ldarg.1 + IL_0012: ldarg.0 + IL_0013: ldfld !1 class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'>::B@ + IL_0018: call int32 [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::GenericHashWithComparerj__TPar'>(class [mscorlib]System.Collections.IEqualityComparer, + !!0) + IL_001d: ldloc.0 + IL_001e: ldc.i4.6 + IL_001f: shl + IL_0020: ldloc.0 + IL_0021: ldc.i4.2 + IL_0022: shr + IL_0023: add + IL_0024: add + IL_0025: add + IL_0026: stloc.0 + IL_0027: ldc.i4 0x9e3779b9 + IL_002c: ldarg.1 + IL_002d: ldarg.0 + IL_002e: ldfld !0 class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'>::A@ + IL_0033: call int32 [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::GenericHashWithComparerj__TPar'>(class [mscorlib]System.Collections.IEqualityComparer, + !!0) + IL_0038: ldloc.0 + IL_0039: ldc.i4.6 + IL_003a: shl + IL_003b: ldloc.0 + IL_003c: ldc.i4.2 + IL_003d: shr + IL_003e: add + IL_003f: add + IL_0040: add + IL_0041: stloc.0 + IL_0042: ldloc.0 + IL_0043: ret + + .line 100001,100001 : 0,0 '' + IL_0044: ldc.i4.0 + IL_0045: ret + } // end of method '<>f__AnonymousType1912756633`2'::GetHashCode + + .method public hidebysig virtual final + instance int32 GetHashCode() cil managed + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 14 (0xe) + .maxstack 8 + .line 1,1 : 1,1 '' + IL_0000: ldarg.0 + IL_0001: call class [mscorlib]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() + IL_0006: tail. + IL_0008: callvirt instance int32 class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'>::GetHashCode(class [mscorlib]System.Collections.IEqualityComparer) + IL_000d: ret + } // end of method '<>f__AnonymousType1912756633`2'::GetHashCode + + .method public hidebysig virtual final + instance bool Equals(object obj, + class [mscorlib]System.Collections.IEqualityComparer comp) cil managed + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 83 (0x53) + .maxstack 5 + .locals init ([0] class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'> V_0, + [1] class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'> V_1) + .line 100001,100001 : 0,0 '' + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: cgt.un + IL_0004: brfalse.s IL_0008 + + IL_0006: br.s IL_000a + + IL_0008: br.s IL_004b + + .line 100001,100001 : 0,0 '' + IL_000a: ldarg.1 + IL_000b: isinst class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'> + IL_0010: stloc.0 + IL_0011: ldloc.0 + IL_0012: brfalse.s IL_0016 + + IL_0014: br.s IL_0018 + + IL_0016: br.s IL_0049 + + .line 100001,100001 : 0,0 '' + IL_0018: ldloc.0 + IL_0019: stloc.1 + IL_001a: ldarg.2 + IL_001b: ldarg.0 + IL_001c: ldfld !0 class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'>::A@ + IL_0021: ldloc.1 + IL_0022: ldfld !0 class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'>::A@ + IL_0027: call bool [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::GenericEqualityWithComparerj__TPar'>(class [mscorlib]System.Collections.IEqualityComparer, + !!0, + !!0) + IL_002c: brfalse.s IL_0030 + + IL_002e: br.s IL_0032 + + IL_0030: br.s IL_0047 + + .line 100001,100001 : 0,0 '' + IL_0032: ldarg.2 + IL_0033: ldarg.0 + IL_0034: ldfld !1 class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'>::B@ + IL_0039: ldloc.1 + IL_003a: ldfld !1 class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'>::B@ + IL_003f: tail. + IL_0041: call bool [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::GenericEqualityWithComparerj__TPar'>(class [mscorlib]System.Collections.IEqualityComparer, + !!0, + !!0) + IL_0046: ret + + .line 100001,100001 : 0,0 '' + IL_0047: ldc.i4.0 + IL_0048: ret + + .line 100001,100001 : 0,0 '' + IL_0049: ldc.i4.0 + IL_004a: ret + + .line 100001,100001 : 0,0 '' + IL_004b: ldarg.1 + IL_004c: ldnull + IL_004d: cgt.un + IL_004f: ldc.i4.0 + IL_0050: ceq + IL_0052: ret + } // end of method '<>f__AnonymousType1912756633`2'::Equals + + .method public hidebysig virtual final + instance bool Equals(class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'> obj) cil managed + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 75 (0x4b) + .maxstack 4 + .line 100001,100001 : 0,0 '' + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: cgt.un + IL_0004: brfalse.s IL_0008 + + IL_0006: br.s IL_000a + + IL_0008: br.s IL_0043 + + .line 100001,100001 : 0,0 '' + IL_000a: ldarg.1 + IL_000b: ldnull + IL_000c: cgt.un + IL_000e: brfalse.s IL_0012 + + IL_0010: br.s IL_0014 + + IL_0012: br.s IL_0041 + + .line 100001,100001 : 0,0 '' + IL_0014: ldarg.0 + IL_0015: ldfld !0 class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'>::A@ + IL_001a: ldarg.1 + IL_001b: ldfld !0 class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'>::A@ + IL_0020: call bool [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::GenericEqualityERj__TPar'>(!!0, + !!0) + IL_0025: brfalse.s IL_0029 + + IL_0027: br.s IL_002b + + IL_0029: br.s IL_003f + + .line 100001,100001 : 0,0 '' + IL_002b: ldarg.0 + IL_002c: ldfld !1 class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'>::B@ + IL_0031: ldarg.1 + IL_0032: ldfld !1 class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'>::B@ + IL_0037: tail. + IL_0039: call bool [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::GenericEqualityERj__TPar'>(!!0, + !!0) + IL_003e: ret + + .line 100001,100001 : 0,0 '' + IL_003f: ldc.i4.0 + IL_0040: ret + + .line 100001,100001 : 0,0 '' + IL_0041: ldc.i4.0 + IL_0042: ret + + .line 100001,100001 : 0,0 '' + IL_0043: ldarg.1 + IL_0044: ldnull + IL_0045: cgt.un + IL_0047: ldc.i4.0 + IL_0048: ceq + IL_004a: ret + } // end of method '<>f__AnonymousType1912756633`2'::Equals + + .method public hidebysig virtual final + instance bool Equals(object obj) cil managed + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 26 (0x1a) + .maxstack 4 + .locals init ([0] class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'> V_0) + .line 1,1 : 1,1 '' + IL_0000: ldarg.1 + IL_0001: isinst class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'> + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: brfalse.s IL_000c + + IL_000a: br.s IL_000e + + IL_000c: br.s IL_0018 + + .line 100001,100001 : 0,0 '' + IL_000e: ldarg.0 + IL_000f: ldloc.0 + IL_0010: tail. + IL_0012: callvirt instance bool class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'>::Equals(class '<>f__AnonymousType1912756633`2') + IL_0017: ret + + .line 100001,100001 : 0,0 '' + IL_0018: ldc.i4.0 + IL_0019: ret + } // end of method '<>f__AnonymousType1912756633`2'::Equals + + .property instance !'j__TPar' A() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 ) + .get instance !'j__TPar' '<>f__AnonymousType1912756633`2'::get_A() + } // end of property '<>f__AnonymousType1912756633`2'::A + .property instance !'j__TPar' B() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 04 00 00 00 01 00 00 00 00 00 ) + .get instance !'j__TPar' '<>f__AnonymousType1912756633`2'::get_B() + } // end of property '<>f__AnonymousType1912756633`2'::B +} // end of class '<>f__AnonymousType1912756633`2' + + +// ============================================================= + +// *********** DISASSEMBLY COMPLETE *********************** diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/env.lst b/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/env.lst index 1a2d7883d52..06f54d7b01e 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/env.lst +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/env.lst @@ -1,53 +1,54 @@ - SOURCE=CodeGenRenamings01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd CodeGenRenamings01.exe" # CodeGenRenamings01.fs - + SOURCE=AnonRecd.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd AnonRecd.exe" # AnonRecd.fs + SOURCE=CodeGenRenamings01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd CodeGenRenamings01.exe" # CodeGenRenamings01.fs - SOURCE=ArgumentNamesInClosures01.fs SCFLAGS="-a -g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd ArgumentNamesInClosures01.dll" # ArgumentNamesInClosures01.fs - - SOURCE=Decimal01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd Decimal01.exe" # Decimal01.fs + SOURCE=Decimal01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd Decimal01.exe" # Decimal01.fs - SOURCE=EntryPoint01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd EntryPoint01.exe" # EntryPoint01.fs + SOURCE=EntryPoint01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd EntryPoint01.exe" # EntryPoint01.fs - SOURCE=EqualsOnUnions01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd EqualsOnUnions01.exe" # EqualsOnUnions01.fs - + SOURCE=EqualsOnUnions01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd EqualsOnUnions01.exe" # EqualsOnUnions01.fs - - SOURCE=ForLoop01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd ForLoop01.exe" # ForLoop01.fs - + SOURCE=ForLoop01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd ForLoop01.exe" # ForLoop01.fs - - SOURCE=ForLoop02.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd ForLoop02.exe" # ForLoop02.fs - SOURCE=ForLoop03.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd ForLoop03.exe" # ForLoop03.fs - SOURCE=NoBoxingOnDispose01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd NoBoxingOnDispose01.exe" # NoBoxingOnDispose01.fs + SOURCE=ForLoop02.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd ForLoop02.exe" # ForLoop02.fs + SOURCE=ForLoop03.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd ForLoop03.exe" # ForLoop03.fs + SOURCE=NoBoxingOnDispose01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd NoBoxingOnDispose01.exe" # NoBoxingOnDispose01.fs - SOURCE=IfThenElse01.fs SCFLAGS="-a -g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd IfThenElse01.dll" # IfThenElse01.fs + SOURCE=IfThenElse01.fs SCFLAGS="-a -g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd IfThenElse01.dll" # IfThenElse01.fs - SOURCE=LetIfThenElse01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd LetIfThenElse01.exe" # LetIfThenElse01.fs - + SOURCE=LetIfThenElse01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd LetIfThenElse01.exe" # LetIfThenElse01.fs - - SOURCE=Lock01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd Lock01.exe" # Lock01.fs - + SOURCE=Lock01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd Lock01.exe" # Lock01.fs - - SOURCE=ModuleWithExpression01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd ModuleWithExpression01.exe" # ModuleWithExpression01.fs + SOURCE=ModuleWithExpression01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd ModuleWithExpression01.exe" # ModuleWithExpression01.fs - SOURCE=NonEscapingArguments02.fs SCFLAGS="-a -g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd NonEscapingArguments02.dll" # NonEscapingArguments02.fs + SOURCE=NonEscapingArguments02.fs SCFLAGS="-a -g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd NonEscapingArguments02.dll" # NonEscapingArguments02.fs - SOURCE=Seq_for_all01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd Seq_for_all01.exe" # Seq_for_all01.fs + SOURCE=Seq_for_all01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd Seq_for_all01.exe" # Seq_for_all01.fs - SOURCE=StructsAsArrayElements01.fs SCFLAGS="-a -g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd StructsAsArrayElements01.dll" # StructsAsArrayElements01.fs - + SOURCE=StructsAsArrayElements01.fs SCFLAGS="-a -g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd StructsAsArrayElements01.dll" # StructsAsArrayElements01.fs - - SOURCE=PreserveSig.fs SCFLAGS="-a -g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd PreserveSig.dll" # PreserveSig.fs - + SOURCE=PreserveSig.fs SCFLAGS="-a -g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd PreserveSig.dll" # PreserveSig.fs - # The name of this test is a bit misleading for legacy reasons: it used to test the --no-generate-filter-blocks option, which is now gone - SOURCE=TryWith_NoFilterBlocks01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TryWith_NoFilterBlocks01.exe" # TryWith_NoFilterBlocks01.fs + SOURCE=TryWith_NoFilterBlocks01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TryWith_NoFilterBlocks01.exe" # TryWith_NoFilterBlocks01.fs - SOURCE=Structs01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd Structs01.exe" # Structs01.fs - - SOURCE=Structs02.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd Structs02.exe" # Structs02.fs - + SOURCE=Structs01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd Structs01.exe" # Structs01.fs - + SOURCE=Structs02.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd Structs02.exe" # Structs02.fs - SOURCE=cas.fs PRECMD="\$CSC_PIPE /t:library /reference:System.Core.dll cas.cs" SCFLAGS="-r cas.dll -g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd cas.exe" # cas.fs - - SOURCE=Marshal.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd Marshal.exe" # Marshal.fs - SOURCE=MethodImplNoInline.fs SCFLAGS="-O" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd MethodImplNoInline.exe" # MethodImplNoInline.fs - SOURCE=MethodImplNoInline02.fs SCFLAGS="-O" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd MethodImplNoInline02.exe" # MethodImplNoInline02.fs + SOURCE=Marshal.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd Marshal.exe" # Marshal.fs + SOURCE=MethodImplNoInline.fs SCFLAGS="-O" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd MethodImplNoInline.exe" # MethodImplNoInline.fs + SOURCE=MethodImplNoInline02.fs SCFLAGS="-O" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd MethodImplNoInline02.exe" # MethodImplNoInline02.fs SOURCE=CustomAttributeGenericParameter01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd CustomAttributeGenericParameter01.exe" # CustomAttributeGenericParameter01.fs - # Need to create 2.0 baseline - SOURCE=GenericTypeStaticField01.fs SCFLAGS="-g --optimize+" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd GenericTypeStaticField01.exe" # GenericTypeStaticField01.fs - + SOURCE=GenericTypeStaticField01.fs SCFLAGS="-g --optimize+" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd GenericTypeStaticField01.exe" # GenericTypeStaticField01.fs - - SOURCE=GeneralizationOnUnions01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd GeneralizationOnUnions01.exe" # GeneralizationOnUnions01.fs + SOURCE=GeneralizationOnUnions01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd GeneralizationOnUnions01.exe" # GeneralizationOnUnions01.fs - SOURCE=AbstractClass.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd AbstractClass.exe" # AbstractClass.fs + SOURCE=AbstractClass.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd AbstractClass.exe" # AbstractClass.fs diff --git a/tests/service/FileSystemTests.fs b/tests/service/FileSystemTests.fs index 947d83a879d..24b45414fd2 100644 --- a/tests/service/FileSystemTests.fs +++ b/tests/service/FileSystemTests.fs @@ -35,7 +35,7 @@ let B = File1.A + File1.A""" interface IFileSystem with // Implement the service to open files for reading and writing member __.FileStreamReadShim(fileName) = - match files.TryGetValue(fileName) with + match files.TryGetValue fileName with | true, text -> new MemoryStream(Encoding.UTF8.GetBytes(text)) :> Stream | _ -> defaultFileSystem.FileStreamReadShim(fileName) @@ -49,7 +49,7 @@ let B = File1.A + File1.A""" defaultFileSystem.FileStreamWriteExistingShim(fileName) member __.ReadAllBytesShim(fileName) = - match files.TryGetValue(fileName) with + match files.TryGetValue fileName with | true, text -> Encoding.UTF8.GetBytes(text) | _ -> defaultFileSystem.ReadAllBytesShim(fileName) diff --git a/tests/service/ProjectAnalysisTests.fs b/tests/service/ProjectAnalysisTests.fs index 517c542aa02..08f19cbe708 100644 --- a/tests/service/ProjectAnalysisTests.fs +++ b/tests/service/ProjectAnalysisTests.fs @@ -5103,48 +5103,48 @@ let ``Test project41 all symbols`` () = yield (s.Symbol.DisplayName, tups s.RangeAlternate, attribsOfSymbol s.Symbol, pos) ] allSymbolUsesInfo |> shouldEqual [("X", ((4, 19), (4, 20)), - ["field"; "anon(0, [//<>f__AnonymousType1416859829`1']X)"], (4, 19)); + ["field"; "anon(0, [//<>f__AnonymousType1416859829`1]X)"], (4, 19)); ("data1", ((4, 8), (4, 13)), ["val"], (4, 8)); ("int", ((7, 23), (7, 26)), ["abbrev"], (0, 0)); ("X", ((7, 19), (7, 20)), - ["field"; "anon(0, [//<>f__AnonymousType1416859829`1']X)"], (7, 19)); + ["field"; "anon(0, [//<>f__AnonymousType1416859829`1]X)"], (7, 19)); ("data1", ((7, 32), (7, 37)), ["val"], (4, 8)); ("data2", ((7, 8), (7, 13)), ["val"], (7, 8)); ("int", ((9, 20), (9, 23)), ["abbrev"], (0, 0)); ("X", ((9, 16), (9, 17)), - ["field"; "anon(0, [//<>f__AnonymousType1416859829`1']X)"], (9, 16)); + ["field"; "anon(0, [//<>f__AnonymousType1416859829`1]X)"], (9, 16)); ("int", ((9, 20), (9, 23)), ["abbrev"], (0, 0)); ("X", ((9, 16), (9, 17)), - ["field"; "anon(0, [//<>f__AnonymousType1416859829`1']X)"], (9, 16)); + ["field"; "anon(0, [//<>f__AnonymousType1416859829`1]X)"], (9, 16)); ("D", ((9, 9), (9, 10)), ["abbrev"], (9, 9)); ("int", ((12, 23), (12, 26)), ["abbrev"], (0, 0)); ("X", ((12, 19), (12, 20)), - ["field"; "anon(0, [//<>f__AnonymousType1416859829`1']X)"], (12, 19)); + ["field"; "anon(0, [//<>f__AnonymousType1416859829`1]X)"], (12, 19)); ("v", ((12, 12), (12, 13)), [], (12, 12)); ("v", ((12, 33), (12, 34)), [], (12, 12)); ("X", ((12, 33), (12, 36)), - ["field"; "anon(0, [//<>f__AnonymousType1416859829`1']X)"], (12, 19)); + ["field"; "anon(0, [//<>f__AnonymousType1416859829`1]X)"], (12, 19)); ("f1", ((12, 8), (12, 10)), ["val"], (12, 8)); ("D", ((15, 16), (15, 17)), ["abbrev"], (9, 9)); ("v", ((15, 12), (15, 13)), [], (15, 12)); ("v", ((15, 21), (15, 22)), [], (15, 12)); ("X", ((15, 21), (15, 24)), - ["field"; "anon(0, [//<>f__AnonymousType1416859829`1']X)"], (9, 16)); + ["field"; "anon(0, [//<>f__AnonymousType1416859829`1]X)"], (9, 16)); ("f2", ((15, 8), (15, 10)), ["val"], (15, 8)); ("int", ((18, 29), (18, 32)), ["abbrev"], (0, 0)); ("string", ((18, 38), (18, 44)), ["abbrev"], (0, 0)); ("X", ((18, 25), (18, 26)), - ["field"; "anon(0, [//<>f__AnonymousType4026451324`2']X,Y)"], (18, 25)); + ["field"; "anon(0, [//<>f__AnonymousType4026451324`2]X,Y)"], (18, 25)); ("Y", ((18, 34), (18, 35)), - ["field"; "anon(1, [//<>f__AnonymousType4026451324`2']X,Y)"], (18, 34)); + ["field"; "anon(1, [//<>f__AnonymousType4026451324`2]X,Y)"], (18, 34)); ("X", ((18, 19), (18, 20)), - ["field"; "anon(0, [//<>f__AnonymousType1416859829`1']X)"], (18, 19)); + ["field"; "anon(0, [//<>f__AnonymousType1416859829`1]X)"], (18, 19)); ("v", ((18, 12), (18, 13)), [], (18, 12)); ("v", ((18, 54), (18, 55)), [], (18, 12)); ("X", ((18, 56), (18, 57)), - ["field"; "anon(0, [//<>f__AnonymousType1416859829`1']X)"], (18, 19)); + ["field"; "anon(0, [//<>f__AnonymousType1416859829`1]X)"], (18, 19)); ("X", ((18, 54), (18, 59)), - ["field"; "anon(0, [//<>f__AnonymousType4026451324`2']X,Y)"], (18, 25)); + ["field"; "anon(0, [//<>f__AnonymousType4026451324`2]X,Y)"], (18, 25)); ("f3", ((18, 8), (18, 10)), ["val"], (18, 8)); ("M", ((2, 7), (2, 8)), ["module"], (2, 7))]